function P7_Uberlink(cl,d){
    var i,ob,tA,h=document.location.href;
    if(document.getElementById){
    ob=(d)?document.getElementById(d):document;
    if(ob){
    tA=ob.getElementsByTagName('A');
    for(i=0;i<tA.length;i++){
      if(tA[i].href==h){
      tA[i].className=cl;
}}}}

}

function inActivation(cl,d){
    var i,ob,tA,h=document.location.href;
    if(document.getElementById){
    ob=document.getElementById(d)
    if(ob){
    tA=ob.getElementsByTagName('A');
    for(i=0;i<tA.length;i++){
      if(tA[i].href=="http://"+document.domain+"/cdcs.php" || tA[i].href=="https://"+document.domain+"/cdcs.php"){
      tA[i].className=cl;
}}}}

}
function ConvertCellsToLinks(xRowId){
        var cells = document.getElementById(xRowId).getElementsByTagName("td");
        for(i=0;i<cells.length;i++){
          var link = cells[i].getElementsByTagName("a")
          if(link.length == 1){
            cells[i].onclick = new Function("document.location.href='" + link[0].href + "'");
            cells[i].onmouseover = new Function("this.className='headerhighlight'");
            cells[i].onmouseout = new Function("this.className=''");
          }
        }
}

function audioPopup(pid, updateCartHeader)
{
	var windowName = 'popupWindow';
	if (updateCartHeader != '')
	{
		windowName = 'popupWindow2';
	} 
	var padLeft = 0;
	if (window.screenLeft)
	{
		padLeft = window.screenLeft;
	}
	if (window.screenX)
	{
		padLeft = window.screenX;
	}
	var left = padLeft + (window.screen.width/2)-300;; //opens over browser window in dual monitor scenario
	var top = (window.screen.height/2)-250;
	newWindow=window.open('/audioPopup.php?products_id='+pid+updateCartHeader,windowName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=500,top='+top+',left='+left)
	newWindow.focus();
	return false;
}
function centeredPopup(URL,width,height)
{
	var windowName = 'centerPop';
	var padLeft = 0;
	if (window.screenLeft)
	{
		padLeft = window.screenLeft;
	}
	if (window.screenX)
	{
		padLeft = window.screenX;
	}
	var left = padLeft + (window.screen.width/2)-width/2; //opens over browser window in dual monitor scenario
	var top = (window.screen.height/2)-height/2;
	newWindow=window.open(URL,windowName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',top='+top+',left='+left)
	newWindow.focus();
	return false;
}

function showTestimonials(createLinks)
{
	var ajaxRequest; 
	
	if (createLinks == null)
		createLinks = false;
		
	try
	{
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (e)
	{
		try
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e)
			{
				alert("Sorry, your browser does not support this feature.");
				return false;
			}
		}
	}
		
	var tag = document.getElementById('tag').value;
		
	var params = "tag="+tag+"&createLinks="+createLinks;

	ajaxRequest.open("POST", "/products/testimonials_async.php", true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	

	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
			var ajaxDisplay = document.getElementById('tmonialsProductContent');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}

	ajaxRequest.send(params); 
} 

