// JavaScript Document

function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}

function get_video_client(id){

	var xmlHttp = getXMLHttp();
		
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById("ambdiv").innerHTML=xmlHttp.responseText;
      }
	 if(xmlHttp.readyState==1||xmlHttp.readyState==2||xmlHttp.readyState==3)
	 {
		 document.getElementById("ambdiv").innerHTML="<img src='admin/images/circleicon.gif' align='middle' > ";
	 }
    }
	
	var url= '<object style="float: left;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="299" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/'+id+'&amp;hl=en_US&amp;fs=1&amp;color1=0x006699&amp;color2=0xFFE329" /><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent" /><embed style="float: left;" type="application/x-shockwave-flash" width="550" height="299" src="http://www.youtube.com/v/'+id+'&amp;hl=en_US&amp;fs=1&amp;color1=0x006699&amp;color2=0xFFE329" wmode="transparent" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
	
	document.getElementById("ambdiv").innerHTML=url;

	
}


function MakeRequest2(brandid,catid,catarray)
{
	
	
  var xmlHttp = getXMLHttp();
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      //alert(xmlHttp.responseText);
	  HandleResponse(xmlHttp.responseText);
	  
    }
  }

  xmlHttp.open("GET", "ajax_all.php?catid="+catid+"&catarr="+catarray+"&brandid="+brandid, true); 
  xmlHttp.send(null);
}


function MakeRequest(brandid,valueid,catid)
{
  var xmlHttp = getXMLHttp();

  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText);
    }
  }

  xmlHttp.open("GET", "ajax.php?valueid="+valueid+"&catid="+catid+"&brandid="+brandid, true); 
  xmlHttp.send(null);
}

function HandleResponse(response)
{
  document.getElementById('productsleftcol').innerHTML = response;
}
