// JavaScript Document
var xmlHttp;
function fnShowModels()
{ 
//document.getElementById("cPath1").disabled=true;
//document.getElementById("cPath1").disabled=false;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
 alert ("Browser does not support HTTP Request");
 return
 }

document.getElementById("lblLoad1").innerHTML="Wait Loading...";
 //var cPath=document.getElementById("cPath").value;
 var cat = document.getElementById("form").ddCat.options[document.getElementById("form").ddCat.options.selectedIndex].value;
 var url="callAjax.php?cat="+cat;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function fnShowModels1()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
 alert ("Browser does not support HTTP Request");
 return
 }

document.getElementById("lblLoad2").innerHTML="Wait Loading...";
var getSelected = document.getElementById("form1").ddCat1.options[document.getElementById("form1").ddCat1.options.selectedIndex].value;
var url="callAjax.php?cat1="+getSelected;
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function fnShowModels2()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
 alert ("Browser does not support HTTP Request");
 return
 }

document.getElementById("lblLoad3").innerHTML="Wait Loading...";
var getSelected = document.getElementById("form2").ddCat2.options[document.getElementById("form2").ddCat2.options.selectedIndex].value;
var url="callAjax.php?cat2="+getSelected;
xmlHttp.onreadystatechange=stateChanged6;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

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;
}
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	//alert(xmlHttp.responseText);
	document.getElementById("getAjax").innerHTML=xmlHttp.responseText ;
 document.getElementById("lblLoad1").innerHTML="";
	
 } 
}
function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	//alert(xmlHttp.responseText);
	document.getElementById("getAjax1").innerHTML=xmlHttp.responseText ;
 document.getElementById("lblLoad2").innerHTML="";
	
 } 
}
function stateChanged6() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	//alert(xmlHttp.responseText);
	document.getElementById("getAjax2").innerHTML=xmlHttp.responseText ;
 document.getElementById("lblLoad3").innerHTML="";
	
 } 
}
function fnGetProducts()
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	 	alert ("Browser does not support HTTP Request");
	 return
	}
	document.getElementById("lblLoad11").innerHTML="Wait Loading...";
	var getSelected = document.getElementById("form").ddCat.options[document.getElementById("form").ddCat.options.selectedIndex].value;
	var getSelected1 = document.getElementById("prod").ddSubCat.options[document.getElementById("prod").ddSubCat.options.selectedIndex].value;
	var url="callAjax.php?subCat="+getSelected1+"&category="+getSelected;
	xmlHttp.onreadystatechange=stateChanged1 ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function fnGetProducts1(subCat)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	 	alert ("Browser does not support HTTP Request");
	 return
	}
	document.getElementById("lblLoad21").innerHTML="Wait Loading...";
	var getSelected = document.getElementById("form1").ddCat1.options[document.getElementById("form1").ddCat1.options.selectedIndex].value;
	var getSelected1 = document.getElementById("prod1").ddSubCat1.options[document.getElementById("prod1").ddSubCat1.options.selectedIndex].value;
	
	var url="callAjax.php?subCat1="+getSelected1+"&category1="+getSelected;
	xmlHttp.onreadystatechange=stateChanged3;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function fnGetProducts2(subCat)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	 	alert ("Browser does not support HTTP Request");
	 return
	}
	document.getElementById("lblLoad31").innerHTML="Wait Loading...";
	var getSelected = document.getElementById("form2").ddCat2.options[document.getElementById("form2").ddCat2.options.selectedIndex].value;
	var getSelected1 = document.getElementById("prod2").ddSubCat2.options[document.getElementById("prod2").ddSubCat2.options.selectedIndex].value;
	//var selected = document.getElementById("frmSpecs2").ddCat2.options[document.getElementById("frmSpecs2").ddCat2.options.selectedIndex].value;
	var url="callAjax.php?subCat2="+getSelected1+"&category2="+getSelected;
	xmlHttp.onreadystatechange=stateChanged7 ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	//alert(xmlHttp.responseText);
	document.getElementById("getModelAjax").innerHTML=xmlHttp.responseText;
	document.getElementById("lblLoad11").innerHTML="";
	
 } 
}
function stateChanged3() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	//alert(xmlHttp.responseText);
	document.getElementById("getModelAjax1").innerHTML=xmlHttp.responseText;
	document.getElementById("lblLoad21").innerHTML="";
	
 } 
}
function stateChanged7() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	//alert(xmlHttp.responseText);
	document.getElementById("getModelAjax2").innerHTML=xmlHttp.responseText;
	document.getElementById("lblLoad31").innerHTML="";
	
 } 
}
function fnCompare()
{
	var pID = document.getElementById("products").ddPro.options[document.getElementById("products").ddPro.options.selectedIndex].value;
	var pID1 = document.getElementById("products1").ddPro1.options[document.getElementById("products1").ddPro1.options.selectedIndex].value;
	var pID2 = document.getElementById("products2").ddPro2.options[document.getElementById("products2").ddPro2.options.selectedIndex].value;
	if(pID!=0 && pID1!=0)
	{
			document.getElementById("lblLoading").src = "images/loading.gif";
			document.getElementById("btnCompare").disabled=true;
			xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null)
			{
				 alert ("Browser does not support HTTP Request");
			 		return
			 }
		    if(pID2!=0)
			var url="callAjax.php?pID="+pID+"&pID1="+pID1+"&pID2="+pID2;
			else
			var url="callAjax.php?pID="+pID+"&pID1="+pID1;
			xmlHttp.onreadystatechange=stateChanged10;
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
			
	}
	else
	{
	alert("Please select Models to compare");
	return false;
	}
	
}
function stateChanged10() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	//alert(xmlHttp.responseText);
	document.getElementById("showDetailsNew").style.visibility = "visible";
	document.getElementById("showDetailsNew").innerHTML=xmlHttp.responseText ;
 document.getElementById("btnCompare").disabled=false;
 document.getElementById("lblLoading").src="images/wt.jpg";
 } 
}
function fnCheckUrl(id)
{
	window.status = "Please Wait You are being redirect";
	location.replace("http://www.laptopreviewsonline.com/track.php?tid="+id);
}
function fnShowModels10()
{ 
//document.getElementById("cPath1").disabled=true;
//document.getElementById("cPath1").disabled=false;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
 alert ("Browser does not support HTTP Request");
 return
 }

document.getElementById("lblLoad1").innerHTML="Wait Loading...";
 //var cPath=document.getElementById("cPath").value;
 var cat = document.getElementById("frmRate").ddCat.options[document.getElementById("frmRate").ddCat.options.selectedIndex].value;
 var url="callAjax.php?cat10="+cat;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function fnGetProductsRev(subCat)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	 	alert ("Browser does not support HTTP Request");
	 return
	}
	document.getElementById("lblLoad11").innerHTML="Wait Loading...";
	var getSelected = document.getElementById("frmRate").ddCat.options[document.getElementById("frmRate").ddCat.options.selectedIndex].value;
	//var getSelected1 = document.getElementById("frmRate").ddSubCat.options[document.getElementById("frmRate").ddSubCat.options.selectedIndex].value;
	var url="callAjax.php?subCatRev="+subCat+"&category10="+getSelected;
	xmlHttp.onreadystatechange=stateChanged1 ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function fnValidate()
{
	var name= document.getElementById("txtName");
	var email= document.getElementById("txtEmail");
	var msg= document.getElementById("txtMsg");
	var check= document.getElementById("txtCheck");
	var check1= document.getElementById("txtCheck1");
	var getSelected = document.getElementById("ddProduct").value;
	var getSelected1 = document.getElementById("ddSubCat").value;

	if(getSelected == 0)
	{
		alert("Please Select Model");
		return false;
	}
	else
	{
	document.getElementById("txtProduct").value = getSelected;
	document.getElementById("txtSubCat").value = getSelected1;
	
	}
	if(name.value=="")
	{
		alert("Please Provide Your Good Name");
		name.focus();
		return false;
	}
	if(email.value =="")
	{
		alert("Please Provide Your Email-Id");
		email.focus();
		return false;
	}
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email.value)) 
	{
		alert("Invalid Email");
		email.focus();
		return false;
	}
	if(msg.value=="")
	{
		alert("Please Type your Message");
		msg.focus();
		return false;
	}
	if(check.value=="")
	{
		alert("Please Enter Security Code");
		check.focus();
		return false;
	}
	else if(check.value!=check1.value)
	{
		alert("Security Code Mismatch");
		check.focus();
		return false;
	}

}
function fnShowImg()
{
	document.getElementById("imgReview").src = "http://laptopreviewsonline.com/images/submit_btno.gif";
	
}
function fnShowImg1()
{
	document.getElementById("imgReview").src = "http://laptopreviewsonline.com/images/submit_btn.gif";
	
}

function addfavoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel(document.title,location.href,""); }
else { window.external.AddFavorite(location.href,document.title); } }