
    var noContent = '';
    var liveReq = false;
    var liveReqLast = '';
    var liveReqDestination = '';

    if (window.XMLHttpRequest) {
        liveReq = new XMLHttpRequest();
    }

    function loadContent(destination, uri) {
        //alert(destination+":"+uri);
        liveReqDestination = destination;
        
        if (liveReqLast != liveReqDestination && liveReqDestination != '') {
        
            //document.getElementById(liveReqDestination).innerHTML = noContent;
        
            if (window.XMLHttpRequest) {
                liveReq = new XMLHttpRequest();
            } else if (window.ActiveXObject) {
                liveReq = new ActiveXObject("Microsoft.XMLHTTP");
            }
        
            liveReq.onreadystatechange = liveReqProcessReqChange;
            liveReq.open('GET', uri);
            liveReq.send(null);
        }
    }

    function liveReqProcessReqChange() 
    {

        if (liveReq.readyState == 4) {
            document.getElementById(liveReqDestination).innerHTML = liveReq.responseText;
        }
    }

    function ajaxUpdater(id,url) 
    {
        //alert('url:'+url);
        new Ajax.Updater(id,url,{asynchronous:true});  
    }  

    function clearDiv(divName) 
    {
        document.getElementById(divName).innerHTML = '';
        document.getElementById(divName).style.display = 'none';
    }

    function showThisPlayer(divName) 
    {
        //alert(divName);
        document.getElementById(divName).style.display = 'block';
    }



    function starRating(product,rating)
    {
        loadContent('rating_'+product, '/starRating.php?id=rating_'+product+'&r='+rating);
    }

    function submitform()
    {
        document.frmCaptcha.submit();
    }

	function getPageHeight()
    {
        // this function makes sure the left and right background images 
        // extend all the way to the bottom of the page body
        var pageHeight = document.getElementById('theDoc').offsetHeight;
        var leftEdge = document.getElementById('left-edge');
        var rightEdge = document.getElementById('right-edge');
        leftEdge.style.height = pageHeight + "px";
        rightEdge.style.height = pageHeight + "px";
	}


    function addToFavorites() 
    { 
        if (window.external) 
        { 
            window.external.AddFavorite(urlAddress,pageName) 
        } 
        else 
        { 
            alert("Sorry! Your browser doesn't support this function."); 
        } 
    }


    function addMediaFav( img ) // add favorite to this users account
    {
        if( !loginManager.isLoggedIn() )
        {
            alert( "You must be logged in to add favorite " + mediatype );
            return;
        }

        img.src = img.src.replace( "Gray", "Over" );
        img.onclick = null;

        var conn = new ajaxConnection( {}, "/ajax/generalClient.php" );
        conn.initRequestObject();
        conn.addVariable( "type", mediatype );
        conn.addVariable( "mediaid", mediaid );
        conn.addVariable( "cmd", "addFavorite" );
        conn.execute();
    } 



    /*
	var sliderIntervalId = 0;
	var sliderHeight = 0;
	var sliding = false;
	var slideSpeed = 10;

	var example1SliderHeight = 232;
	var example1SliderIntervalId = 0;
	var example1Sliding = false;

	function Example1Slide()
	{
	   if(example1Sliding)
		  return;
	   example1Sliding = true;
	   if(example1SliderHeight == 232)
		  example1SliderIntervalId = setInterval('Example1SlideUpRun()', 30);
	}

	function Example1SlideUpRun()
	{
	   slider = document.getElementById('example1ElementId');
	   if(example1SliderHeight <= 0)
	   {
		  example1Sliding = false;
		  example1SliderHeight = 0;
		  slider.style.height = '0px';
		  clearInterval(example1SliderIntervalId);
	   }
	   else
	   {
		  example1SliderHeight -= slideSpeed;
		  if(example1SliderHeight < 0)
			 example1SliderHeight = 0;
		  slider.style.height = example1SliderHeight + 'px';
	   }
	}

	function Slide()
	{
       slider = document.getElementById('sliderContent');
       slider.style.display = "block";
	   //contentHeight = document.getElementById('sliderContent').scrollHeight;
	   contentHeight = 39;
       
       //contentHeight = "";
	   //sliderHeight = 1;
       alert('sliderHeight:'+sliderHeight+" | "+'contentHeight:'+contentHeight+" | sliding:"+sliding);
	   if(sliding)
       {
          alert('done');
		  return;
       }

	   sliding = true;
	   if(sliderHeight == contentHeight)
       {
		  alert('up');
		  sliderIntervalId = setInterval('SlideUpRun()', 30);
       }
	   //else if(sliderHeight == 0)
          //sliderIntervalId = setInterval('SlideDownRun()', 30);
	   else
		  sliderIntervalId = setInterval('SlideDownRun()', 30);

//	   alert('nothing');

	}

	function SlideUpRun()
	{
//       alert('SlideUpRun | sliding:'+sliding);
	   slider = document.getElementById('sliderContent');
	   
	   if(sliderHeight <= 0)
	   {
//          alert('contentHeight:'+contentHeight);
          sliding = false;
          sliderHeight = 0;
	      slider.style.visibility = "hidden";
          
          //slider.style.height = '0px';
		  slider.scrollHeight = contentHeight;
          slider.style.display = "none";
          clearInterval(sliderIntervalId);
		  
	   }
	   else
	   {
		  sliderHeight -= slideSpeed;
		  if(sliderHeight < 0)
			 sliderHeight = 0;
		  slider.style.height = sliderHeight + 'px';
	   }
	}

	function SlideDownRun()
	{
	   slider = document.getElementById('sliderContent');


//       alert('sliderHeight:'+sliderHeight+" | "+'contentHeight:'+contentHeight);
	   if(sliderHeight >= contentHeight)
	   {
		  
//		  alert('down1');
		  sliding = false;
		  sliderHeight = contentHeight;
		  //slider.style.height = contentHeight;
		  clearInterval(sliderIntervalId);
	   }
	   else
	   {
//		  alert('down2');
	   slider.style.visibility = "visible";
	   //slider.style.display = "block";
		  sliderHeight += slideSpeed;
		  if(sliderHeight > contentHeight)
			 sliderHeight = contentHeight;
		  slider.style.height = sliderHeight + 'px';
	   }
	}

*/

