// Klick dölj / visa
var span;
function swap_content( span ) {
    displayType = ( document.getElementById( span ).style.display == 'none' ) ? 'block' : 'none';
    document.getElementById( span ).style.display = displayType;
	var img1 = new Image();
	var img2 = new Image();
	var imageType = new Image();
	img2.src = "images/icon_expand.gif";
	img1.src = "images/icon_collapse.gif";
	
	imgId = "img_"+span;
	
	
	//imageType.src = ( document.getElementById(imgId).src == img1.src) ? img2.src : img1.src;
	
//	document.getElementById(imgId).src = imageType.src;

	
	}

var xmlHttp

function showHint(str, page,arg, spin)
{
	
	if (spin == undefined){
		span = "txtHint";
	} else {
		span = spin;
	}
	
	
if (str.length<2)
  { 
   //document.getElementById("txtHint").innerHTML=""
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 
//var url="AJAXproductsearch.php"
var url = page
url=url+"?q="+ str; 
url=url+"&group_id="+arg
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
if (xmlHttp.overrideMimeType) {
	
          // xmlHttp.overrideMimeType('text/xml; charset=iso-8859-1');
} 

xmlHttp.send(null)
} 

function stateChanged() 
{ 

if (xmlHttp.readyState==3) 
	{
	//document.getElementById("loading").innerHTML='<img src="images/loading.gif" />';	
	} 
	
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById(span).innerHTML=xmlHttp.responseText
 //document.getElementById("loading").innerHTML='Klar!';
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

/*$(document).ready(function () {
  $('.bubbleInfo').each(function () {
 
    // options
    var distance = 10;
    var time = 250;
    var hideDelay = 500;

    var hideDelayTimer = null;

    // tracker
    var beingShown = false;
    var shown = false;
    
    var trigger = $('.trigger', this);
    var popup = $('.popup', this).css('opacity', 0);

    // set the mouseover and mouseout on both element
    $([trigger.get(0), popup.get(0)]).mouseover(function () {
      // stops the hide event if we move from the trigger to the popup element
      if (hideDelayTimer) clearTimeout(hideDelayTimer);

      // don't trigger the animation again if we're being shown, or already visible
      if (beingShown || shown) {
        return;
      } else {
        beingShown = true;

        // reset position of popup box
        popup.css({
          top: -10,
          left: -33,
          display: 'block' // brings the popup back in to view
        })

        // (we're using chaining on the popup) now animate it's opacity and position
        .animate({
          top: '-=' + distance + 'px',
          opacity: 1
        }, time, 'swing', function() {
          // once the animation is complete, set the tracker variables
          beingShown = false;
          shown = true;
        });
      }
    }).mouseout(function () {
      // reset the timer if we get fired again - avoids double animations
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      
      // store the timer so that it can be cleared in the mouseover if required
      hideDelayTimer = setTimeout(function () {
        hideDelayTimer = null;
        popup.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function () {
          // once the animate is complete, set the tracker variables
          shown = false;
          // hide the popup entirely after the effect (opacity alone doesn't do the job)
          popup.css('display', 'none');
        });
      }, hideDelay);
    });
  });
});*/