var movieName = "testimonial";
var http = false;

//setup ajax call to fix video load issues with firefox
function rotvideo(video){
    if (window.XMLHttpRequest) {
       http = new XMLHttpRequest();
    }
    else {
        if (window.ActiveXObject) {
            try {
                http = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) { }
        }
    }  

    //var sortValue = (document.sortform.sortBy.value) ? document.sortform.sortBy.value : MSRP;
    //var resultsValue = (document.sortform.resultsPP.value) ? document.sortform.resultsPP.value : 10;
    //var docID = (document.sortform.pageID.value) ? document.sortform.pageID.value : 3;
    //document.sortform.resultsPP.value = resultsValue;
    myRand = parseInt(Math.random()*999999999999999);
    if (http) {
        http.onreadystatechange = showContents;
        http.open("GET", "/assets/snippets/rightside/rightside2.inc.php?video=" + video, true);
        http.send(null);
    }
    else {
        document.getElementById("media_player").innerHTML = "Sorry, but I couldn't create an XMLHttpRequest";
    }
    
}

function showContents() {
   if (http.readyState == 4) {
    if(http.status == 200) {
       var page = http.responseText;
       document.getElementById('media_player').innerHTML = page;
       document.getElementById('loadStatus').innerHTML = '';
    }
  } else {
  document.getElementById('media_player').innerHTML = '<img src="/assets/images/indicator.white.gif">';
  }
}


		

function playmovie(testVideo) {

	if (navigator.appName.indexOf ("Microsoft") !=-1) {

		window[movieName].LoadMovie(0, "/assets/flash/" + testVideo + ".swf");

	} else {

		rotvideo(testVideo);

	}
}		 



function setMediabg(box){
	document.getElementById('media_link_0').style.background = 'transparent';
	document.getElementById('media_link_1').style.background = 'transparent';
	document.getElementById('media_link_2').style.background = 'transparent';
	document.getElementById('media_link_' + box).style.background = '#686868';	
}
  

function setheight()

{

 var rightSize = document.getElementById('content_right').offsetHeight;

 var leftSize = document.getElementById('content_left').offsetHeight;

 	if(leftSize < rightSize)

 	{

 		document.getElementById('content_main').style.height = rightSize - 30 + 'px';

	}

	

}


var popupWin =null;
function openNew(pProd,wValue,hValue) { if (popupWin != null){ if (navigator.appName == "Netscape") { popupWin=null; popupWin = pProd; popupWin = window.open(pProd,null,'width=' + wValue + ',height=' + hValue + ',left=' + screen.avalWidth - (wValue/2) + 'screeny=0,top=0,screenx=' + screen.avalWidth - (wValue/2) + ',toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no'); popupWin.focus(); popupWin=null; popupWin.close();}
else { popupWin.close();}
}
popupWin = pProd; popupWin = window.open(pProd,null,'left=0,top=0,width=' + wValue + ',height=' + hValue + ',toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes'); if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3") ){ popupWin.focus();}
}



function checkAll(){
	for (var i=0;i<document.form1.elements.length;i++)
	{
		var e=document.form1.elements[i];
		if ((e.name != 'allbox') && (e.type=='checkbox'))
		{
			e.checked=document.form1.allbox.checked;
		}
	}
}


		