// JavaScript Document

var xmlHttp = null;

var xmlAddCartHttp;

var xmlLoginHttp;

var xmlForgotpwd;

var xmlChangepwdHttp;

var xmlCheckUserHttp;

var xmlCheckEmailHttp;

var xmlLogUserHttp;

var xmlRegInsertHttp;

var xmlLoadIndexProductHttp;

var xmlLoadProductHttp;

var xmlLogOffHttp;

var xmlpostcommentsHttp;

var xmlfeedbackcommentsHttp;

var xmlreviewcommentsHttp;

var cartQtys='';

var cartShopIds='';

var Pquantity='';

var ShopAmt='';

//var xmlDeleteCartHttp;

var glbProducyDetailId;

var overlayDuration = 0.4;

var MyDisplayDiv;

var overlayDuration1 = 0.4;

var MyDisplayDiv1;

var overlayDuration2 = 0.4;

var MyDisplayDiv2;

var password;

var get_id;

var ProductList;

var Rate_Type;

//var xmlLoadShopListsHttp;

var xmlCheckoutInsertHttp = null;



function shopmore()

{

window.location="showroom.php";	

}

function billing()

{

window.location="checkout.php";	

}

function loginfunction()

{

window.location="login.php";	

}



function displayBox(DisplayConcept) {}

function newDisplayBox() {

////alert(MyDisplayDiv);

vp = getViewPort();

document.getElementById(MyDisplayDiv).className='myclass';

document.getElementById(MyDisplayDiv).style.top = (vp.yScroll + parseInt(vp.h/2, 10) - parseInt(200/2, 10)) + 'px';

document.getElementById(MyDisplayDiv).style.left = (parseInt(vp.w/2, 10) - parseInt(300/2, 10)) + 'px';

Element.hide(MyDisplayDiv); 

new Effect.Appear(MyDisplayDiv);

}



function displayBox_back(DivName) {}



function newDisplayBox_back() {

new Effect.Fade('fade2');

//document.getElementById('fade').className='black_overlay';

}



function mycontact(DisplayConcept) {}





function checkurl() {}



function addNavigation(navData,getid){}



function addnav(maincat,subcat,productid) {}





function loadproducts(page,c) {}



function stateProducts() {

	try {

		if(xmlLoadProductHttp.readyState==4 || xmlLoadProductHttp.readyState=="complete") {

			try{

				document.getElementById("listproducts").innerHTML = "";

			var result = xmlLoadProductHttp.responseText;

			////alert(result);

				document.getElementById("listproducts").innerHTML = result;

			} catch(e) {

			//alert(e.description);

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



function indexproducts() {

	try {

	var url = "includes/index.products.php";

	

	////alert(url);

		xmlLoadIndexProductHttp=GetXmlHttpObject();

		xmlLoadIndexProductHttp.onreadystatechange = stateindexproducts;

		xmlLoadIndexProductHttp.open("GET",url,true);

		xmlLoadIndexProductHttp.send(null);

		document.getElementById("indexlist").innerHTML = "<img src=images/product-loader.gif>";

	} catch(e) {

	//alert(e.discription);

	}

}



function stateindexproducts() {

	try {

		if(xmlLoadIndexProductHttp.readyState==4 || xmlLoadIndexProductHttp.readyState=="complete") {

			try{

				document.getElementById("indexlist").innerHTML = "";

			var result = xmlLoadIndexProductHttp.responseText;

			////alert(result);

				document.getElementById("indexlist").innerHTML = result;

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}





function loadproductDetail(productid) { 

	try {

		//var RatingValue=Ratingvalue;var Ratingvalue;

		//alert(Rate_Type);

		var url = "includes/load.product.detail.php?productid="+productid+"&Pcid="+get_id+"&RateValue="+Rate_Type;

	////alert(url);

		xmlLoadProductDetailHttp = GetXmlHttpObject();

		xmlLoadProductDetailHttp.onreadystatechange = stateProductDetail;

		xmlLoadProductDetailHttp.open("GET",url,true);

		xmlLoadProductDetailHttp.send(null);

		document.getElementById("listproducts").innerHTML = "<img src=images/product-loader.gif>";

	} catch(e) {

	//alert(e.discription + "Error MYn");

	}

}



function stateProductDetail() {

	try {

		if(xmlLoadProductDetailHttp.readyState==4 || xmlLoadProductDetailHttp.readyState=="complete") {

			try{

				document.getElementById("listproducts").innerHTML = "";

			var result = xmlLoadProductDetailHttp.responseText;

			////alert(result);

				document.getElementById("listproducts").innerHTML = result;

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



function loadShopCarts() {

	try {

	var url = "includes/load.shopping.lists.php";

	////alert(url);

		xmlLoadShopListsHttp = GetXmlHttpObject();

		xmlLoadShopListsHttp.onreadystatechange = stateLoadShopLists;

		xmlLoadShopListsHttp.open("GET",url,true);

		xmlLoadShopListsHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}





function stateLoadShopLists() {

	try {

		if(xmlLoadShopListsHttp.readyState<=3)

		{

			document.getElementById("shoppinglists").innerHTML = "<img src=images/shopping-loader.gif>";	

		}

		else if(xmlLoadShopListsHttp.readyState==4 || xmlLoadShopListsHttp.readyState=="complete") {

			try{

			var result = xmlLoadShopListsHttp.responseText;

			////alert(result);

			result = result.split("counter");

			////alert(result[1]);

				document.getElementById("shoppinglists").innerHTML = result[0];

				document.getElementById("shoppingcounts").innerHTML = result[1];

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}

function loadShopCart() {

	try {

	var url = "includes/load.shopping.list.php";

	////alert(url);

		xmlLoadShopListHttp = GetXmlHttpObject();

		xmlLoadShopListHttp.onreadystatechange = stateLoadShopList;

		xmlLoadShopListHttp.open("GET",url,true);

		xmlLoadShopListHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}



function stateLoadShopList() {

	try {

		if(xmlLoadShopListHttp.readyState<=3)

		{

			document.getElementById("shoppinglist").innerHTML = "<img src=images/shopping-loader.gif>";	

		}

		else if(xmlLoadShopListHttp.readyState==4 || xmlLoadShopListHttp.readyState=="complete") {

			try{

			var result = xmlLoadShopListHttp.responseText;

			////alert(result);

			result = result.split("counter");

			////alert(result[1]);

				document.getElementById("shoppinglist").innerHTML = result[0];

				document.getElementById("shoppingcount").innerHTML = result[1];

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}





function updatecart() {

var pqty = document.getElementsByName('pqty[]');

var sid = document.getElementsByName('sid[]');   

var Amt = document.getElementsByName('Amt[]');

var qty = document.getElementsByName('qty[]');

var pqtyLength = pqty.length;

var sidLength = sid.length;

var amtLength = Amt.length;

var qtyLength = qty.length;

////alert(qtyLength);

	for ( i=0; i < pqtyLength; i++ ) {

		if((pqty[i].value==0) || (pqty[i].value==00) || (pqty[i].value==000) || (pqty[i].value==""))

		{

			pqty[i].value=1;

			cartQtys += pqty[i].value + ",";

			////alert(cartQtys);

		alert(pqty[i]);

		}

		else if(pqty[i].value!="undefined") {

		cartQtys += pqty[i].value + ",";

		////alert(cartQtys);

		}

	}

	for ( j=0; j < sidLength; j++ ) {

		if(sid[j].value!="undefined") {

		cartShopIds += sid[j].value + ",";

		}

	}

	for ( k=0; k < qtyLength; k++ ) {

		if(qty[k].value!="undefined") {

		Pquantity += qty[k].value + ",";

		////alert(Pquantity);

		}

	}

	for ( l=0; l < amtLength; l++ ) {

		if(Amt[l].value!="undefined") {

		ShopAmt += Amt[l].value + ",";

		////alert(Pquantity);

		}

	}

	////alert(cartQtys + "-" + cartShopIds);

	try {

		

	var url = "includes/update.cart.php?productqtys=" + cartQtys + "&shoppingids=" + cartShopIds +"&ProductQuantity="+Pquantity +"&Totalamt="+ShopAmt;

	////alert(url);

		xmlUpdateCartHttp = GetXmlHttpObject();

		xmlUpdateCartHttp.onreadystatechange = stateUpdateCart;

		xmlUpdateCartHttp.open("GET",url,true);

		xmlUpdateCartHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}

function updatecarts() {

var pqtys = document.getElementsByName('pqtys[]');

var sids = document.getElementsByName('sids[]');   

var Amts = document.getElementsByName('Amts[]');

var qtys = document.getElementsByName('qtys[]');

var pqtyLengths = pqtys.length;

var sidLengths = sids.length;

var amtLengths = Amts.length;

var qtyLengths = qtys.length;

////alert(qtyLength);

	for ( i=0; i < pqtyLengths; i++ ) {

		if((pqtys[i].value==0) || (pqtys[i].value==00) || (pqtys[i].value==000) || (pqtys[i].value==""))

		{

			pqtys[i].value=1;

			cartQtys += pqtys[i].value + ",";

			////alert(cartQtys);

			////alert(pqty[i]);

		}

		else if(pqtys[i].value!="undefined") {

		cartQtys += pqtys[i].value + ",";

		////alert(cartQtys);

		}

	}

	for ( j=0; j < sidLengths; j++ ) {

		if(sids[j].value!="undefined") {

		cartShopIds += sids[j].value + ",";

		}

	}

	for ( k=0; k < qtyLengths; k++ ) {

		if(qtys[k].value!="undefined") {

		Pquantity += qtys[k].value + ",";

		////alert(Pquantity);

		}

	}

	for ( l=0; l < amtLengths; l++ ) {

		if(Amts[l].value!="undefined") {

		ShopAmt += Amts[l].value + ",";

		////alert(Pquantity);

		}

	}

	////alert(cartQtys + "-" + cartShopIds);

	try {

		

	var url = "includes/update.carts.php?productqtys=" + cartQtys + "&shoppingids=" + cartShopIds +"&ProductQuantity="+Pquantity +"&Totalamt="+ShopAmt;

	////alert(url);

		xmlUpdateCartHttp = GetXmlHttpObject();

		xmlUpdateCartHttp.onreadystatechange = stateUpdateCarts;

		xmlUpdateCartHttp.open("GET",url,true);

		xmlUpdateCartHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}



function stateUpdateCart() {

	try {

		if(xmlUpdateCartHttp.readyState==4 || xmlUpdateCartHttp.readyState=="complete") {

			try{

			document.getElementById('error_occur').style.display="none";

			//document.getElementById('error_occurs').style.display="none";

			var result = xmlUpdateCartHttp.responseText;

			////alert(result);

			var s_result = result.substring(result.length-9,result.length)

			////alert(s_result);

			if(s_result=="updated" || s_result=="edupdated" || s_result=="teupdated") {

			//alert(s_result);

			//document.getElementById('error_occur').style.display="none";alert("hai");

			loadShopCart();

			loadShopCarts();

			}

			else if(s_result=="Notupdate")

			{

				////alert(s_result);

				document.getElementById('error_occur').innerHTML = "sorry stock not available";

				document.getElementById('error_occur').style.display="inline";

				loadShopCart();

				

				//loadShopCarts();

			}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}

function stateUpdateCarts() {

	try {

		if(xmlUpdateCartHttp.readyState==4 || xmlUpdateCartHttp.readyState=="complete") {

			try{

			document.getElementById('error_occurs').style.display="none";

			var result = xmlUpdateCartHttp.responseText;

			////alert(result);

			var s_result = result.substring(result.length-9,result.length)

			////alert(s_result);

			if(s_result=="updated" || s_result=="edupdated" || s_result=="teupdated") {

			//alert(s_result);

			//document.getElementById('error_occur').style.display="none";alert("hai");

			loadShopCarts();

			loadShopCart();

			}

			else if(s_result=="Notupdate")

			{

				////alert(s_result);

				

				document.getElementById('error_occurs').innerHTML = "sorry stock not available";

				document.getElementById('error_occurs').style.display="inline";

				loadShopCarts();

				//loadShopCart();

			}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



//var pqty = document.getElementsByName('pqty[]');



function validname(pqty) {

	pqty.value = pqty.value.replace(/[^\u00D1\u00F10-9]*/ig,'');

} 



/*function deletecart(shoppingid) {

		try {

		var url = "includes/delete.cart.php?shoppingid=" + shoppingid;

		////alert(url);

		xmlDeleteCartHttp = GetXmlHttpObject();

		xmlDeleteCartHttp.onreadystatechange = stateDeleteCart;

		xmlDeleteCartHttp.open("GET",url,true);

		xmlDeleteCartHttp.send(null);

		} catch(e) {

		//alert(e.discription);

		}

}



function stateDeleteCart() {

	try {

		if(xmlDeleteCartHttp.readyState==4 || xmlDeleteCartHttp.readyState=="complete") {

			try{

			var result = xmlDeleteCartHttp.responseText;

			////alert(result);

				if(result=="deleted") {

				loadShopCart();

				loadShopCarts();

				}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}

*/

/*

function del()

{

	var d = confirm("Do you want delete this product?");

	return d;

	document.getElementById('error_occur').style.display="none";

	document.getElementById('error_occurs').style.display="none";

}*/



/*function addcart(productid,product_qty,user_id) {

	try {

	var url = "includes/addto.cart.php?productid=" + productid  + "&product_qty=" + product_qty + "&user_id="+ user_id;

	////alert(url);

		xmlAddCartHttp = GetXmlHttpObject();

		xmlAddCartHttp.onreadystatechange = stateAddCart;

		xmlAddCartHttp.open("GET",url,true);

		xmlAddCartHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}



function stateAddCart() {

	try {

		if(xmlAddCartHttp.readyState==4 || xmlAddCartHttp.readyState=="complete") {

			try{

			

			var result = xmlAddCartHttp.responseText;

				if(result=="added") 

				{

					////alert(result);

					loadShopCart();

					document.getElementById('error_occur').style.display="none";

					loadShopCarts();

					document.getElementById('error_occurs').style.display="none";

				}

				else if(result=="Notadded") 

				{

					////alert(result);

					document.getElementById('error_occur').innerHTML = "Sorry stock not available";

					document.getElementById('error_occur').style.display="inline";

					document.getElementById('error_occurs').innerHTML = "Sorry stock not available";

					document.getElementById('error_occurs').style.display="inline";

				}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}

*/



function LogUser() {

	try {

	var url = "includes/user.status.php";

	////alert(url);

		xmlLogUserHttp = GetXmlHttpObject();

		xmlLogUserHttp.onreadystatechange = stateLogUser;

		xmlLogUserHttp.open("GET",url,true);

		xmlLogUserHttp.send(null);

		//document.getElementById("LogOff").innerHTML = "<img src=images/product-loader.gif>";

	} catch(e) {

	//alert(e.discription + "Error MYn");

	}

}



function stateLogUser() {

	try {

		if(xmlLogUserHttp.readyState==4 || xmlLogUserHttp.readyState=="complete") {

			try{

				

			var result = xmlLogUserHttp.responseText;

			

			if(result==1) {

					document.getElementById("UserOut").style.visibility = "hidden";

					document.getElementById("UserIn").style.visibility = "visible";

					document.getElementById("UserIn").style.height = "15px";

					document.getElementById("UserOut").style.height = "0px";

					//document.getElementById("CheckOther").style.display = "none";

					//document.getElementById("CheckUser").style.display = "block";

				} 

				

			if(result==0) {

				document.getElementById("UserIn").style.visibility = "hidden";

				document.getElementById("UserOut").style.visibility = "visible";

				document.getElementById("UserOut").style.height = "15px";

				document.getElementById("UserIn").style.height = "0px";

				//document.getElementById("CheckUser").style.display = "none";

				//document.getElementById("CheckOther").style.display = "block";

				}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



function LogOff() {

	try {

	var url = "includes/sign.out.user.php";

	////alert(url);

		xmlLogOffHttp = GetXmlHttpObject();

		xmlLogOffHttp.onreadystatechange = stateLogOff;

		xmlLogOffHttp.open("GET",url,true);

		xmlLogOffHttp.send(null);

		//document.getElementById("LogOff").innerHTML = "<img src=images/product-loader.gif>";

	} catch(e) {

	//alert(e.discription + "Error MYn");

	}

}



function stateLogOff() {

	try {

		if(xmlLogOffHttp.readyState==4 || xmlLogOffHttp.readyState=="complete") {

			try {

				//document.getElementById("LogOff").innerHTML = "";

			var result = xmlLogOffHttp.responseText;

			////alert(result);

			if(result=="sign off") {

					window.location.reload();

//					addNavigation('Index');

					var uname = document.getElementById("loginuname").value="";

					var pass = document.getElementById("pass").value="";

					//var errpass = document.getElementById("errpass").style.display = "none";

					LogUser();

				}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



// ## login valid End ## //



// ## Change Pasword ## //



function checkLoginForm() 

{

	var loginuname = document.getElementById("loginuname").value;

	var pass = document.getElementById("pass").value;

	

	/////  regular exp ////

	var reWhiteSpace = new RegExp(/^\s+$/);

	var stringval = new RegExp(/^[a-zA-Z]/);

	

	/////////// user name starts //////////

	if (loginuname== "") {

	hideAllErrors();

	document.getElementById("erruser").style.display = "inline";

	document.getElementById("erruser").innerHTML="Please enter user name";

	document.getElementById("loginuname").select();

	document.getElementById("loginuname").focus();

	return false;

	}

	

	else if (reWhiteSpace.test(loginuname)) {

	hideAllErrors();

	document.getElementById("erruser").innerHTML="Whitespace is not allowed";

	document.getElementById("erruser").style.display = "inline";

	document.getElementById("loginuname").value="";

	document.getElementById("loginuname").select();

	document.getElementById("loginuname").focus();

	return false;

	}

	

	if(pass=="") {

	hideAllErrors();

	document.getElementById("errpass").style.display = "inline";

	document.getElementById("errpass").innerHTML="Please Enter Password";

	document.getElementById("pass").select();

	document.getElementById("pass").focus();

	return false;

	}

		

	if (reWhiteSpace.test(pass)) {

	hideAllErrors();

	document.getElementById("errpass").innerHTML="Whitespace is not allowed";

	document.getElementById("errpass").style.display = "inline";

	document.getElementById("pass").value="";

	document.getElementById("pass").select();

	document.getElementById("pass").focus();

	return false;

	}

	

	var myurl = "includes/login.user.php?uname=" + document.getElementById("loginuname").value + "&pass=" + document.getElementById("pass").value

	////alert(myurl);

	xmlLoginHttp=GetXmlHttpObject();

	xmlLoginHttp.onreadystatechange=stateChanged;

	//alert

	xmlLoginHttp.open("post",myurl,true);

	xmlLoginHttp.send(null);

	return false;

	//document.getElementById("loader").style.display = "inline";

}



function stateChanged() 

{ 

	if (xmlLoginHttp.readyState==4 || xmlLoginHttp.readyState=="complete")

	{ 

	var result = xmlLoginHttp.responseText;

	arres = result.split("~~")

	////alert(result);

		if(arres[0]=="correct") 

		{



			window.location="index.php";

	return false;

			

			/*document.getElementById("signinDiv").style.display = "none";

			//addNavigation('Index');

			LogUser();

			document.getElementById('errpass').style.display="none";

			document.getElementById('erruser').style.display="none";*/

		}

		 

		else if(result=="username") 

		{

			document.getElementById("errpass").innerHTML = "Incorrect Username";	

	return false;  

		} 

		else if(result=="password") 

		{

			document.getElementById("errpass").innerHTML = "Incorrect Password";	 

	return false; 

		} 

		else if(result=="in correct") 

		{

			document.getElementById("errpass").innerHTML = "Wrong username or password";

	return false;

		} 

		

		else  

		{

			document.getElementById('errpass').style.display="none";

			document.getElementById('erruser').style.display="none";

	return false;

		}

	}

}





function checkForgotpwd() 

{

	var forgotpwd = document.getElementById("forgotp").value;

	

	/////  regular exp ////

	var reWhiteSpace = new RegExp(/^\s+$/);

	var stringval = new RegExp(/^[a-zA-Z]/);

	//alert(forgotpwd);

	if (forgotpwd=="") {

	//hideAllErrors();

	document.getElementById("Forgot_Username").style.display = "inline";

	document.getElementById("Forgot_Username").innerHTML="Please enter your E-mail";

	document.getElementById("ForgotMailError").style.display="none";

	document.getElementById("ForgotMailError1").style.display="none";

	document.getElementById("ForgotMailError2").style.display="none";

	document.getElementById("GetPass").style.display="none";

	document.getElementById("GetNotPass").style.display="none";

	return false;

	}

	

	else if (reWhiteSpace.test(forgotpwd)) {

	//hideAllErrors();

	document.getElementById("Forgot_Username").innerHTML="Whitespace is not allowed";

	document.getElementById("Forgot_Username").style.display = "inline";

	document.getElementById("forgotpwd").value="";

	document.getElementById("ForgotMailError").style.display="none";

	document.getElementById("ForgotMailError1").style.display="none";

	document.getElementById("ForgotMailError2").style.display="none";

	document.getElementById("GetPass").style.display="none";

	document.getElementById("GetNotPass").style.display="none";

	return false;

	}

	

	else if((forgotpwd.charCodeAt(0)< 97 || forgotpwd.charCodeAt(0) > 122)&&(forgotpwd.charCodeAt(0) < 65 || forgotpwd.charCodeAt(0) > 90)) 

	{

		document.getElementById("ForgotMailError2").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Email address should start with a character</font>";

		document.getElementById("ForgotMailError2").style.display="inline";

		document.getElementById("Forgot_Username").style.display="none";

		document.getElementById("ForgotMailError").style.display="none";

		document.getElementById("ForgotMailError1").style.display="none";

		document.getElementById("GetPass").style.display="none";

		document.getElementById("GetNotPass").style.display="none";

		return false;

	}

	

	else if (!isNotEmail(forgotpwd)) {

	//hideAllErrors();

	//alert("hai");

	document.getElementById("ForgotMailError1").style.display = "inline";

	document.getElementById("ForgotMailError2").style.display="none";

	document.getElementById("Forgot_Username").style.display="none";

	return false;

	}

	

	else if (!checkemail(forgotpwd)) {

	//hideAllErrors();

	//alert("hai");

	document.getElementById("ForgotMailError1").style.display = "inline";

	document.getElementById("ForgotMailError2").style.display="none";

	document.getElementById("Forgot_Username").style.display="none";

	return false;

	}

	

	var myurl = "includes/forgot.pwd.php?forgotpwd=" + document.getElementById("forgotp").value;

	////alert(myurl);

	xmlForgotpwd=GetXmlHttpObject();

	xmlForgotpwd.onreadystatechange=stateCheckforgotpwd;

	xmlForgotpwd.open("post",myurl,true);

	xmlForgotpwd.send(null);

	//return false;

	//document.getElementById("loader").style.display = "inline";

}



function stateCheckforgotpwd() 

{ 

	if (xmlForgotpwd.readyState==4 || xmlForgotpwd.readyState=="complete")

	{ 

	var result = xmlForgotpwd.responseText;

	sresult = result.split("~");

	

		if(result=="CheckForgotEmail")

		{   

			document.getElementById("ForgotMailError").innerHTML="There is no user registered with this email address.";

			document.getElementById("ForgotMailError").style.display="inline";

			document.getElementById("Forgot_Username").style.display="none";

			document.getElementById("ForgotMailError1").style.display="none";

			document.getElementById("ForgotMailError2").style.display="none";

			document.getElementById("GetPass").style.display="none";

			document.getElementById("GetNotPass").style.display="none";

		}

		

		else if(result=="SendPass")

		{

			

			//document.getElementById("GetPass").innerHTML="The Password has been sent to your mail address";

			//document.getElementById("GetPass").style.display="inline";

			document.getElementById("GetNotPass").style.display="none";

			document.getElementById("Forgot_Username").style.display="none";

			document.getElementById("ForgotMailError").style.display="none";

			document.getElementById("ForgotMailError1").style.display="none";

			document.getElementById("ForgotMailError2").style.display="none";

			document.getElementById("forgotp").value="";

			//document.getElementById("forgotDiv").style.display="none";

			//addNavigation('Index');

			alert("The Password has been sent to your mail address");

			window.location="login.php";

		}

		

		else if(sresult[1]=="NotSend")

		{

			//alert("failure");

			document.getElementById("GetNotPass").innerHTML="There was a problem to sending mail";

			document.getElementById("GetNotPass").style.display="inline";

			document.getElementById("GetPass").style.display="none";

			document.getElementById("Forgot_Username").style.display="none";

			document.getElementById("ForgotMailError").style.display="none";

			document.getElementById("ForgotMailError1").style.display="none";

			document.getElementById("ForgotMailError2").style.display="none";

			document.getElementById("forgotp").value="";

		}

	}

}



function checkChangePasswd() 

{

	var OP = document.getElementById("OP").value; // Old Password

	var NP = document.getElementById("NP").value; // New Password

	var CP = document.getElementById("CP").value; // Confirm Password



	/////  regular exp ////

	var reWhiteSpace = new RegExp(/^\s+$/);

	var stringval = new RegExp(/^[a-zA-Z]/);

	

	/////////// user name starts //////////

	if (OP=="") {

	//hideAllErrors();

	document.getElementById("OldError").style.display="inline";

	document.getElementById("OldError").innerHTML="Please enter old password";

	document.getElementById("OP").select();

	document.getElementById("OP").focus();

	return false;

	}

	

	else if (reWhiteSpace.test(OP)) {

	//hideAllErrors();

	document.getElementById("OldError").innerHTML="Whitespace is not allowed";

	document.getElementById("OldError").style.display="inline";

	document.getElementById("OP").value="";

	document.getElementById("OP").select();

	document.getElementById("OP").focus();

	return false;

	}

	

	if(NP=="") {

	//hideAllErrors();

	document.getElementById("NewError").style.display="inline";

	document.getElementById("NewError").innerHTML="Please enter new password";

	document.getElementById("PError").style.display="none";

	document.getElementById("NP").select();

	document.getElementById("NP").focus();

	return false;

	}

		

	if (reWhiteSpace.test(NP)) {

	//hideAllErrors();

	document.getElementById("NewError").innerHTML="Whitespace is not allowed";

	document.getElementById("NewError").style.display="inline";

	document.getElementById("NP").value="";

	document.getElementById("NP").select();

	document.getElementById("NP").focus();

	return false;

	}

	

	if(NP.length < 6){

	//hideAllErrors();

	document.getElementById("PError").innerHTML="Please enter greaterthan 6 char of password";

	document.getElementById("PError").style.display="inline";

	document.getElementById("NewError").style.display="none";

	document.getElementById("NP").select();

	document.getElementById("NP").focus();

	return false;

	}

	

	if(CP=="") {

	//hideAllErrors();

	document.getElementById("ConfirmError").style.display="inline";

	document.getElementById("ConfirmError").innerHTML="Please enter confirm password";

	document.getElementById("CPError").style.display="none";

	document.getElementById("CP").select();

	document.getElementById("CP").focus();

	return false;

	}

		

	if (reWhiteSpace.test(CP)) {

	//hideAllErrors();

	document.getElementById("ConfirmError").innerHTML="Whitespace is not allowed";

	document.getElementById("ConfirmError").style.display="inline";

	document.getElementById("CPError").style.display="none";

	document.getElementById("CP").value="";

	document.getElementById("CP").select();

	document.getElementById("CP").focus();

	return false;

	}

	

	if(CP.length < 6){

	//hideAllErrors();

	document.getElementById("CPError").innerHTML="Please enter greaterthan 6 char of password";

	document.getElementById("CPError").style.display="inline";

	document.getElementById("ConfirmError").style.display="none";

	document.getElementById("CP").select();

	document.getElementById("CP").focus();

	return false;

	}

	

	var myurl = "includes/change.pwd.php?OP=" + document.getElementById("OP").value + "&NP=" + document.getElementById("NP").value + "&CP=" + document.getElementById("CP").value;

	////alert(myurl);

	xmlChangepwdHttp=GetXmlHttpObject();

	xmlChangepwdHttp.onreadystatechange=stateChangedpwd;

	xmlChangepwdHttp.open("post",myurl,true);

	xmlChangepwdHttp.send(null);

	//document.getElementById("loader").style.display = "inline";

}



function stateChangedpwd() 

{ 

	if (xmlChangepwdHttp.readyState==4 || xmlChangepwdHttp.readyState=="complete")

	{ 

	

	var result = xmlChangepwdHttp.responseText;

	////alert(result);

		if(result=="WrongPass")

		{

			document.getElementById("ConfirmPassError").innerHTML="Please enter your correct password";

			document.getElementById("ConfirmMissmatch").style.display="none";

			document.getElementById("OldError").style.display="none";

			document.getElementById("NewError").style.display="none";

			document.getElementById("ConfirmError").style.display="none";

			document.getElementById("PError").style.display="none";

			document.getElementById("CPError").style.display="none";

			document.getElementById("PasswordChanged").style.display="none";

			

		}

		

		else if(result=="MissMatch")

		{

			document.getElementById("ConfirmMissmatch").innerHTML="Missmatch your password";

			document.getElementById("ConfirmMissmatch").style.display="inline";

			document.getElementById("ConfirmPassError").style.display="none";

			document.getElementById("OldError").style.display="none";

			document.getElementById("NewError").style.display="none";

			document.getElementById("ConfirmError").style.display="none";

			document.getElementById("PError").style.display="none";

			document.getElementById("CPError").style.display="none";

			document.getElementById("PasswordChanged").style.display="none";

		}

		

		else if(result=="UP")

		{

			

			document.getElementById("PasswordChanged").innerHTML="Your password is changed";

			document.getElementById("PasswordChanged").style.display="inline";

			document.getElementById("OP").value="";

			document.getElementById("NP").value="";

			document.getElementById("CP").value="";

			document.getElementById("OldError").style.display="none";

			document.getElementById("NewError").style.display="none";

			document.getElementById("ConfirmError").style.display = "none";

			document.getElementById("ConfirmPassError").style.display="none";

			document.getElementById("ConfirmMissmatch").style.display="none";

			//document.getElementById("ChangeDiv").style.display = "none";

			document.getElementById("PError").style.display="none";

			document.getElementById("CPError").style.display="none";

			window.location="index.php"



		}

	

	}

}



function addCommands()

{

	////alert(document.getElementById("txt_Commands").value);

	//errcommands

		

		if(trim(document.getElementById("txt_Commands").value)=="")

		{

			document.getElementById('errcommands').innerHTML="Please enter your valid comments";

			document.getElementById('errcommands').style.display="block";

		}



		else

		{

			xmlpostcommentsHttp=GetXmlHttpObject();

			xmlpostcommentsHttp.onreadystatechange=add_state;

			xmlpostcommentsHttp.open("GET","includes/commands.php?commands="+document.getElementById("txt_Commands").value,true);

			xmlpostcommentsHttp.send(null);

			document.getElementById('errcommands').style.display="none";

		}

}



function add_state() 

{ 

	if (xmlpostcommentsHttp.readyState==4 || xmlpostcommentsHttp.readyState=="complete")

	{ 

		//var result = xmlpostcommentsHttp.responseText;

		//alert("Your comments has been posted successfully");

		document.getElementById("txt_Commands").value="";

		window.location="bestsellers.php";

		/*addNavigation('ShowThread9');*/

	}

}



function post_comments(categ)

{	

	document.getElementById("txt_Commands").value="";

	xmlpostcommentsHttp=GetXmlHttpObject();

	url = "includes/commands.php?cate="+categ;

	xmlpostcommentsHttp.onreadystatechange=post_state;

	xmlpostcommentsHttp.open("GET",url,true);

	xmlpostcommentsHttp.send(null);

}



function post_state() 

{ 

	if (xmlpostcommentsHttp.readyState==4 || xmlpostcommentsHttp.readyState=="complete")

	{ 

		document.getElementById("txt_Commands").value="";

		document.getElementById('errcommands').innerHTML="";

		addNavigation('post_comments');

	}

}



function review_comments(cate)

{	

	xmlreviewcommentsHttp=GetXmlHttpObject();

	xmlreviewcommentsHttp.onreadystatechange=review_state;

	xmlreviewcommentsHttp.open("GET","includes/reviewlisting.php?cate="+cate);

	xmlreviewcommentsHttp.send(null);

}



function review_state() 

{ 

	if (xmlreviewcommentsHttp.readyState==4 || xmlreviewcommentsHttp.readyState=="complete")

	{ 

		document.getElementById("reviewcomments").innerHTML=xmlreviewcommentsHttp.responseText;

		addNavigation('review_comments');

	}

}



/*function trim(s)

{   var i;

    var returnString = "";

    // Search through string's characters one by one.

    // If character is not a whitespace, append to returnString.

    for (i = 0; i < s.length; i++)

    {   

        // Check that current character isn't whitespace.

        var c = s.charAt(i);

        if (c != " ") returnString += c;

    }

    return returnString;

}*/



function feedbackCommands()

{

	////alert(document.getElementById("txt_Commands").value);

	//errcommands

		var char=/^[a-z\sA-z\.]*$/;

		if(trim(document.getElementById("txt_Feedbacks").value)=="")

		{   

			document.getElementById('errfeedback').innerHTML="Please enter your valid feedbacks";

			document.getElementById('errfeedback').style.display="block";

		}

		else if (!char.test(document.getElementById("txt_Feedbacks").value))

		{

			document.getElementById('errfeedback').innerHTML="Only Characters allowed";

			document.getElementById('errfeedback').style.display="block";

		}



		else

		{   

			xmlfeedbackcommentsHttp=GetXmlHttpObject();

			xmlfeedbackcommentsHttp.onreadystatechange=feedbackadd_state;

			xmlfeedbackcommentsHttp.open("GET","includes/feedback.php?feedbacks="+document.getElementById("txt_Feedbacks").value,true);

			xmlfeedbackcommentsHttp.send(null);

			document.getElementById('errfeedback').style.display="none";

		}

}



function feedbackadd_state() 

{ 

	if (xmlfeedbackcommentsHttp.readyState==4 || xmlfeedbackcommentsHttp.readyState=="complete")

	{ 

		//var result = xmlpostcommentsHttp.responseText;

		////alert(document.getElementById("txt_Feedbacks").value.length);

		//alert("Your comments has been posted successfully");

		document.getElementById("txt_Feedbacks").value="";

		document.getElementById("errfeedback").style.display="none";

		window.location="contactus.php";

	}

}



function hideAllErrors() {

document.getElementById("erruser").style.display = "none";

document.getElementById("errpass").style.display = "none";

}



//login valid completed

var glbpromocode='';



function checkPromoAvailability(promocode)

{

	glbpromocode = promocode;

//alert(promocode);

	try {

		var url = 'php/promo.availability.php?promocode='+promocode;

	  //alert(url);

	    xmlCheckPromoCodeHttp=GetXmlHttpObject();

	    xmlCheckPromoCodeHttp.onreadystatechange = stateCheckPromoCode;

		xmlCheckPromoCodeHttp.open("post",url,true);

	    xmlCheckPromoCodeHttp.send(null);

	  document.getElementById("promocodehere").innerHTML="<img src=images/ajax_throbber.gif>";

	} catch(e) {

	//alert(e.discription);

	}

}



function stateCheckPromoCode()	

{



	if (xmlCheckPromoCodeHttp.readyState==4 || xmlCheckPromoCodeHttp.readyState=="complete") 

	{

		//document.getElementById("uname_err").innerHTML=xmlCheckPromoCodeHttp.responseText 003300

		var result=xmlCheckPromoCodeHttp.responseText;

		//alert(result);

		/*if(result=="notavailable") {

		//document.getElementById("uname_err").innerHTML="PromoCodeName Not Available";

		//document.getElementById("RegisterDiv").style.display = "none";

		//addNavigation('ShowRoom');

		//LogUser();

		}*/ 

		document.getElementById("promocodehere").innerHTML="";

		if(result=="error")

		{

		document.getElementById("promocodehere").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>User Promocode is Wrong</font>";

		document.getElementById('promocodehere').style.display="inline";

		//document.getElementById("uname_err").style.display="none";

		//document.getElementById("reguname").value="";

		}  

		else if(result=="correct") 

		{

		document.getElementById("promocodehere").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#003300'>Your Promocode Accepted</font>";

		document.getElementById('promocodehere').style.display="inline";

//		document.getElementById('errpass').style.display="none";

		//document.getElementById("uname_err").style.display="inline";

		}

	} 

}





//Register validation



function validation(dynamic,str,filename) {



    var element;

   	var FirstError = '';

	var lastElement = '';

	var Content = '';

	var last = '';

	var lcon = '';

	var radioErr = '';

	var prvPass = '';

	var prvEmail = '';

	var QueryString = '';

	var totData = '';

	var xmlInsertHttp;

	password=dynamic.elements[1].value;

   	for (i = 0; i < dynamic.elements.length; i++) 

	{

        element = dynamic.elements[i];



			if(str.search(element.name)==-1)

			{

			

				

switch (element.type) 

{

case 'text':



var Regname = element.name;



if(Regname.search("uname")!=-1)

{

	if(element.value=="")

	{	

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter your name</font>";

		document.getElementById("uname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(element.value.length < 3)

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter greater than 3 characters</font>";

		document.getElementById("uname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if((element.value.charCodeAt(0)< 97 || element.value.charCodeAt(0) > 122)&&(element.value.charCodeAt(0) < 65 || element.value.charCodeAt(0) > 90))

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Name should be start with a character</font>";

		document.getElementById("uname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		document.getElementById("uname_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}



var checkoutname = element.name;



if(checkoutname.search("checkoutname")!=-1)

{

	if(element.value=="")

	{	

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter your name</font>";

		document.getElementById("checkoutname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(element.value.length < 3)

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter greater than 3 characters</font>";

		document.getElementById("checkoutname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if((element.value.charCodeAt(0)< 97 || element.value.charCodeAt(0) > 122)&&(element.value.charCodeAt(0) < 65 || element.value.charCodeAt(0) > 90))

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Name should be start with a character</font>";

		document.getElementById("checkoutname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		document.getElementById("checkoutname_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}





var Bill = element.name;



if(Bill.search("billname")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter your name</font>";

		document.getElementById("billname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(element.value.length < 3)

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter greater than 3 characters</font>";

		document.getElementById("billname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if((element.value.charCodeAt(0)< 97 || element.value.charCodeAt(0) > 122)&&(element.value.charCodeAt(0) < 65 || element.value.charCodeAt(0) > 90))

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Billing name should start with a character</font>";

		document.getElementById("billname_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById("billname_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}



var Billcity = element.name;



if(Billcity.search("city")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the city name</font>";

		document.getElementById("city_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if((element.value.charCodeAt(0)< 97 || element.value.charCodeAt(0) > 122)&&(element.value.charCodeAt(0) < 65 || element.value.charCodeAt(0) > 90))

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>City name should start with a character</font>";

		document.getElementById("city_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(!charcheck(element.value))

	{

		document.getElementById("city_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById("city_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}



var BillState = element.name;



if(BillState.search("state")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the state name</font>";

		document.getElementById("state_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if((element.value.charCodeAt(0)< 97 || element.value.charCodeAt(0) > 122)&&(element.value.charCodeAt(0) < 65 || element.value.charCodeAt(0) > 90))

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>State name should start with a character</font>";

		document.getElementById("state_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(!charcheck(element.value))

	{

		document.getElementById("state_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById("state_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}





var Billzipcode = element.name;



if(Billzipcode.search("zipcode")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the zipcode</font>";

		document.getElementById("zipcode_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(!validateZIP(element.value))

	{

		//document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Please enter the valid zipcode</font>";

		document.getElementById("zipcode_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById("zipcode_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}



/*var Billphoneno = element.name;



if(Billphoneno.search("phoneno")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the mobile number</font>";

		document.getElementById("phoneno_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(!checkInternationalPhone(element.value))

	{

		document.getElementById("phoneno_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter a valid mobile number</font>";

		document.getElementById("phoneno_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(!Numbersonly(element.value))

	{

		document.getElementById("phoneno_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if((element.value < 10))

	{

		document.getElementById("phoneno_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter a 10-digit valid mobile number</font>";

		document.getElementById("phoneno_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById("phoneno_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}

*/

var myval = element.name;



if(myval.search("mail")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the E-mail</font>";

		document.getElementById("mail_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if((element.value.charCodeAt(0)< 97 || element.value.charCodeAt(0) > 122)&&(element.value.charCodeAt(0) < 65 || element.value.charCodeAt(0) > 90)) 

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Email address should start with a character</font>";

		document.getElementById("mail_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(!isNotEmail(element.value)) 

	{

		document.getElementById("mail_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(!checkemail(element.value))

	{

		document.getElementById("mail_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		//document.getElementById("mail_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}





// ## Billing Information Mail ## //



var BillMail = element.name;



if(BillMail.search("Email")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the E-mail</font>";

		document.getElementById("Email_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if((element.value.charCodeAt(0)< 97 || element.value.charCodeAt(0) > 122)&&(element.value.charCodeAt(0) < 65 || element.value.charCodeAt(0) > 90)) 

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Email address should start with a character</font>";

		document.getElementById("Email_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(!isNotEmail(element.value)) 

	{

		document.getElementById("Email_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(!checkemail(element.value))

	{

		document.getElementById("Email_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		document.getElementById("Email_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}

break;

			

case 'textarea':



var address = element.name;



if(address.search("address")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the address</font>";

		document.getElementById("address_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(!checkspecial(element.value))

	{

		document.getElementById("address").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		//document.getElementById("address_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}



var shippingaddress = element.name;



if(shippingaddress.search("shippingaddress")!=-1)

{

	////alert(element.name);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter the address 2</font>";

		document.getElementById("shippingaddress_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else if(!checkspecialShipping(element.value))

	{

		document.getElementById("shippingaddress_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		document.getElementById("shippingaddress_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}

break;



case 'password':



var pwd = element.name;



if(pwd.search('pass')!=-1)

{

	////alert(pwd);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter password</font>";

		document.getElementById("pass_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(element.value.length<6) 

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px;color:#FF0000'>Password should be at least 6 characters long</font>";

		document.getElementById("pass_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		document.getElementById("pass_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

	

}



var cpwd = element.name;



if(cpwd.search('cpass')!=-1)

{

	if(element.value=="")

	{

		document.getElementById("cpass_err").style.display="inline";

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter confirm password</font>";

		FirstError += element.name + ",";	

	}

	else if(password!=element.value)



	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Password missmatch</font>";

		document.getElementById("cpass_err").style.display="inline";

		FirstError += element.name + ",";

	}



	else

	{

		document.getElementById(element.name+"_err").innerHTML="";

		document.getElementById("cpass_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}	

}	

break;



case 'select-one':



var BillShipping = element.name;



if(BillShipping.search("shippingmethod")!=-1)

{

	////alert(Billshippingmethod);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please select the shippingmethod</font>";

		document.getElementById("shippingmethod_err").style.display="inline";

		FirstError += element.name + ",";

	}

	else

	{

		document.getElementById("shippingmethod_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}



var BillTerms = element.name;



if(BillTerms.search("terms")!=-1)

{

	////alert(element.value);

	if(element.value=="")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please select the Terms</font>";

		document.getElementById("terms_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else if(element.value=="-Select-")

	{

		document.getElementById(element.name+"_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please select the Terms</font>";

		document.getElementById("terms_err").style.display="inline";

		FirstError += element.name + ",";

	}

	

	else

	{

		document.getElementById("terms_err").style.display="none";

		totData += element.name + '=' + escape(element.value) + '&';

		QueryString += element.name + "=" + element.value + "&";

	}

}

break;



case 'hidden':

if(element.value=="")

{

	document.getElementById(element.name+"_err").innerHTML="<img src=images/delete.png>";

	FirstError += element.name + ",";

}

else

{

	document.getElementById(element.name+"_err").innerHTML="<img src=images/checkbullet.gif>";

	totData += element.name + '=' + escape(element.value) + '&';

	QueryString += element.name + "=" + element.value + "&";

}

break;

		

case 'radio':

if (element.checked)

{

	if (element.name == last)

	{

		if (lcon.lastIndexOf('&') == lcon.length-1)

		{

			lcon = lcon.substr(0, lcon.length - 1);

		}

			lcon += ',' + escape(element.value);

		} 

		else 

		{

			lcon += element.name + '=' + escape(element.value);

		}

			lcon += '&';

			last = element.name;

			document.getElementById(element.name+"_err").innerHTML="<img src=images/checkbullet.gif>";

			//document.getElementById(element.name+"_label").className="content";

		} 

		else 

		{

			document.getElementById(element.name+"_err").innerHTML="<img src=images/delete.png>";

			//document.getElementById(element.name+"_label").className="err_content";

			if(FirstError.search(element.name)==-1) {

			FirstError += element.name + ",";

		}

	}

break;



case 'checkbox':

if (element.checked)

{

	if (element.name == lastElement)

	{

		if (Content.lastIndexOf('&') == Content.length-1)

		{

			Content = Content.substr(0, Content.length - 1);

		}

			Content += ',' + escape(element.value);

		} 

		else 

		{

			Content += element.name + '=' + escape(element.value);

		}

			Content += '&';

			lastElement = element.name;

			document.getElementById(element.name+"_err").innerHTML="<img src=images/checkbullet.gif>";

			//document.getElementById(element.name+"_label").className="content";

		} 

		else

		{

		document.getElementById(element.name+"_err").innerHTML="<img src=images/delete.png>";

			if(FirstError.search(element.name)==-1)

			{

				FirstError += element.name + ",";

			}

		}

break;

			default:

				totData += lcon;

				totData += Content;

				QueryString += Content;

				var result = Content.split("&");

				for(a=0;a<result.length-1;a++)

				{

				var newdata = result[a].split("=");

					if(newdata[1].length>0) 

					{

						FirstError = FirstError.replace(newdata[0]+",","");

						document.getElementById(newdata[0]+"_err").innerHTML="";

					}

				}

				QueryString += lcon;

				var res = lcon.split("&");

				for(b=0;b<res.length-1;b++)

				{

					var data = res[b].split("=");

					if(data[1].length>0)

					{

						FirstError = FirstError.replace(data[0]+",","");

						document.getElementById(data[0]+"_err").innerHTML="";	

					}

				}

				if(QueryString.length>255) 

				{

					////alert("QueryString is Greater than 255 :" + QueryString.length);

				}

				////alert(QueryString);

				conErr = FirstError.split(",");

				if(conErr[0]=="country")

				{

				FirstError="";

				}

				if(FirstError.length>0) 

				{

					var resErr = FirstError.split(",");

					if(resErr[0]=="country")

					{

					return true;

					}

					else

					{

					document.getElementsByName(resErr[0])[0].focus();

					return false;

					}

				}

				else if(filename.length>0)

				{	

			//alert(filename);

			if(filename=="php/shoping.bill.php") {

				//salert("comin");

					var url = filename + '?' + totData + "promocode="+ glbpromocode;

				//alert(url);

					xmlCheckoutInsertHttp=GetXmlHttpObject();

					xmlCheckoutInsertHttp.onreadystatechange=stateCheckoutInsert;

					xmlCheckoutInsertHttp.open("get",url,true);

					xmlCheckoutInsertHttp.send(null);

			} else {

					var url = filename + '?' + totData;

					xmlRegInsertHttp=GetXmlHttpObject();

					xmlRegInsertHttp.onreadystatechange=stateRegInsert;

					xmlRegInsertHttp.open("get",url,true);

					xmlRegInsertHttp.send(null);

			}

			//alert(url);

					/*xmlRegInsertHttp=GetXmlHttpObject();

					xmlRegInsertHttp.onreadystatechange=stateRegInsert;

					xmlRegInsertHttp.open("get",url,true);

					xmlRegInsertHttp.send(null);*/

				}

				break;

		}

    	}else{ // (non mantadory fields)

		totData += element.name + '=' + escape(element.value)+ '&';

		//alert(totData);	

	     }

	}

}



function stateRegInsert() 

{ 

	if (xmlRegInsertHttp.readyState==4 || xmlRegInsertHttp.readyState=="complete")

	{ 

		var result = xmlRegInsertHttp.responseText;

//alert(result);

		//sresult = result.split("~");

		//if(result==1) {

			//alert("Successfully Registered...!");

			//window.location = "delivery.info.php";

			//document.getElementById("RegisterDiv").style.display = "none";

			//document.getElementById("RegisterResultDiv").style.display = "block";

			/*document.getElementById("uname").value="";

			document.getElementById("pass").value="";

			document.getElementById("cpass").value="";

			document.getElementById("mail").value="";*/

			//displayBox2('signinDiv');

			//window.location="index.php";

			//window.location="login.php";

			/*window.close();

			window.opener.location.reload();*/

			

		//} else

		if(result==2) {

				//document.getElementById("CheckoutDiv").style.display = "none";

				//document.getElementById("Emptycheck").style.dispaly="none";

//				document.getElementById("billname").value="";

//				document.getElementById("address").value="";

//				document.getElementById("shippingaddress").value="";

//				document.getElementById("country").value="";

//				document.getElementById("state").value="";

//				document.getElementById("city").value="";

//				document.getElementById("zipcode").value="";

//				document.getElementById("Email").value="";

//				document.getElementById("phoneno").value="";

				//document.getElementById(element.name+"_err").innerHTML="";

				//addNavigation('ShowRoom');

			alert("Successfully inserted...!");

				//window.location="includes/paypal.check.php";

		} 

		else if(result==3) 

		{

			document.getElementById("mail_err").style.display = "block";

			document.getElementById("mail_err").innerHTML="Change UserName or Email";

		}

		else if(result==4) 

		{

			document.getElementById("uname").value = "";

			document.getElementById("Email").value = "";

			alert("Thank you for signing up to receive our newsletter!");

		}

		else if(result=="error") 

		{

			document.getElementById("Email_err").style.display = "block";

			document.getElementById("Email_err").innerHTML="Already Subscribed to this EmailId";

		} else {

			alert(result);

			window.location = "delivery.info.php?id=" +result;

		}

	}

}





function stateCheckoutInsert() 

{ 

	if (xmlCheckoutInsertHttp.readyState==4 || xmlCheckoutInsertHttp.readyState=="complete")

	{ 

		var result = xmlCheckoutInsertHttp.responseText;

		//window.location = "https://www.imaginabox.com/home/delivery-id=" + result +"-promoid-"+ glbpromocode;

//alert(result);

		//sresult = result.split("~");

		//if(result==1) {

			//alert("Successfully Registered...!");

			window.location = "https://www.imaginabox.com/home/delivery.php?id=" +result +"&promoid=" + glbpromocode;

			

			//document.getElementById("RegisterDiv").style.display = "none";

			//document.getElementById("RegisterResultDiv").style.display = "block";

			/*document.getElementById("uname").value="";

			document.getElementById("pass").value="";

			document.getElementById("cpass").value="";

			document.getElementById("mail").value="";*/

			//displayBox2('signinDiv');

			//window.location="index.php";

			//window.location="login.php";

			/*window.close();

			window.opener.location.reload();*/

			

		//} else



	}

}





function Cartempty()

{

var b = document.getElementsByTagName('input');

//////alert(b);

var count=0;

for (i=0;i<b.length;i++)

{

	var box=b[i];

		if(	box.value!='' && box.type=='text')

		{

		count++;

		break;

		}

}



	if (count!="")

	{

		//////alert(count);

		//////alert('You put something in the box');

		document.getElementById('Errorempty').innerHTML="Quantity should not be empty";

	}

	else 

	{

		//alert ('You Must Enter Something in the box ');

		document.getElementById('Errorempty').innerHTML="Quantity should not be empty";

		//document.getElementById('Errorempty').style.display="none";

	}

return true;

	

}



/*    mailstr=value;

	

	a = mailstr.indexOf(".");



	b = mailstr.indexOf("@");



	c = mailstr.indexOf(" ");

	

	d = mailstr.lastIndexOf(".");



	e = mailstr.length;



	if( (a == -1) || (b == -1) || (c != -1) || (d < b) || ( d == e - 1) || (b+1 == a) )

	{

	  return true

	}

	else

	return false;*/



function validateZIP(field)

{

var valid = "0123456789-";

var hyphencount = 0;



if (field.length!=5)

{

//////alert("Please enter your 5 digit or 5 digit+4 zip code.");

document.getElementById("zipcode_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Please enter valid zipcode.</font>";

//Please enter your 5 digit or 5 digit+4 zip code.

return false;

}

for (var i=0; i < field.length; i++) {

temp = "" + field.substring(i, i+1);

if (temp == "-") hyphencount++;

if (valid.indexOf(temp) == "-1") {

//////alert("Invalid characters in your zip code.  Please try again.");

document.getElementById("zipcode_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Invalid characters in your zip code.</font>";

return false;

}

//if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {

////////alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");

//document.getElementById("zipcode_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>The hyphen character should be used with a properly formatted 5 digit+four zip code, like '123456-7890'.Please try again.</font>";

//return false;

//   }

}

return true;

}





function isNotEmail(value)

{

	/* The following variable tells the rest of the function whether or not

	to verify that the address ends in a two-letter country or well-known

	TLD.  1 means check it, 0 means don't. */

	var checkTLD=1;

	/* The following is the list of known TLDs that an e-mail address must end with. */

	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

	/* The following pattern is used to check if the entered e-mail address

	fits the user@domain format.  It also is used to separate the username

	from the domain. */

	var emailPat=/^(.+)@(.+)$/;

	/* The following string represents the pattern for matching all special

	characters.  We don't want to allow special characters in the address. 

	These characters include ( ) < > @ , ; : \ " . [ ] */

	var specialChars="\\(\\)><@,;:\\\\\\\"\\_\\[\\]";

	var specialCharsfordot="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

	/* The following string represents the range of characters allowed in a 

	username or domainname.  It really states which chars aren't allowed.

	*/

	var validChars="\[^\\s" + specialChars + "\]";

	var validCharsdot="\[^\\s" + specialCharsfordot + "\]";

	/* The following pattern applies if the "user" is a quoted string (in

	which case, there are no rules about which characters are allowed

	and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com

	is a legal e-mail address. */

	var quotedUser="(\"[^\"]*\")";

	/* The following pattern applies for domains that are IP addresses,

	rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal

	e-mail address. NOTE: The square brackets are required. */

	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

	/* The following string represents an atom (basically a series of non-special characters.) */

	var atom=validChars + '+';

	var atomdot=validCharsdot + '+';

	/* The following string represents one word in the typical username.

	For example, in john.doe@somewhere.com, john and doe are words.

	Basically, a word is either an atom or quoted string. */

	var word="(" + atom + "|" + quotedUser + ")";

	var worddot="(" + atomdot + "|" + quotedUser + ")";

	// The following pattern describes the structure of the user

    var userPats=new RegExp("^" + worddot + "(\\." + worddot + ")*$");

	var userPat=new RegExp("^" + word + "(\\_" + word + ")*$");

	/* The following pattern describes the structure of a normal symbolic

	domain, as opposed to ipDomainPat, shown above. */

	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

	/* Finally, let's start trying to figure out if the supplied address is valid. */

	/* Begin with the coarse pattern to simply break up user@domain into

	different pieces that are easy to analyze. */

	var matchArray=value.match(emailPat);

	if (matchArray==null)

	{

		/* Too many/few @'s or something; basically, this address doesn't

		even fit the general mould of a valid e-mail address. */

		//////alert("Email address seems incorrect (check @ and . )");

		document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Email address seems incorrect (check @ and . )</font>";

		document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Email address seems incorrect (check @ and . )</font>";

		document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Email address seems incorrect (check @ and . )</font>";

		document.getElementById("Forgot_Username").style.display="none";

		document.getElementById("ForgotMailError").style.display="none";

		document.getElementById("ForgotMailError2").style.display="none";

		document.getElementById("GetPass").style.display="none";

		document.getElementById("GetNotPass").style.display="none";

		return false;

	}

	var user=matchArray[1];

	var domain=matchArray[2];

	// Start by checking that only basic ASCII characters are in the strings (0-127).

	for (i=0; i<user.length; i++)

	{

		if (user.charCodeAt(i)>127)

		{

			//////alert("This Email Address contains invalid characters.");

			document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This Email Address contains invalid characters</font>";

			document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This Email Address contains invalid characters</font>";

			document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This Email Address contains invalid characters</font>";

			document.getElementById("Forgot_Username").style.display="none";

			document.getElementById("ForgotMailError").style.display="none";

			document.getElementById("ForgotMailError2").style.display="none";

			document.getElementById("GetPass").style.display="none";

			document.getElementById("GetNotPass").style.display="none";

			return false;

		}

	}

	for (i=0; i<domain.length; i++)

	{

		if (domain.charCodeAt(i)>127)

		{

			//////alert("This domain name contains invalid characters.");

			document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This domain name contains invalid characters</font>";

			document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This domain name contains invalid characters</font>";

			document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This domain name contains invalid characters</font>";

			document.getElementById("Forgot_Username").style.display="none";

			document.getElementById("ForgotMailError").style.display="none";

			document.getElementById("ForgotMailError2").style.display="none";

			document.getElementById("GetPass").style.display="none";

			document.getElementById("GetNotPass").style.display="none";

			return false;

		}

	}

	// See if "user" is valid 

	if (user.match(userPat)==null)

	{

	// user is not valid

		//////alert("Invalid Email.");

		document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Invalid Email</font>";

		//document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Invalid Email</font>";

		document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Invalid Email</font>";

		document.getElementById("Forgot_Username").style.display="none";

		document.getElementById("ForgotMailError").style.display="none";

		document.getElementById("ForgotMailError2").style.display="none";

		document.getElementById("GetPass").style.display="none";

		document.getElementById("GetNotPass").style.display="none";

		return false;

	}

	

	if (user.match(userPats)==null)

	{

	// user is not valid

		//////alert("Invalid Email.");

		document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Invalid Email</font>";

		document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Invalid Email</font>";

		document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Invalid Email</font>";

		document.getElementById("Forgot_Username").style.display="none";

		document.getElementById("ForgotMailError").style.display="none";

		document.getElementById("ForgotMailError2").style.display="none";

		document.getElementById("GetPass").style.display="none";

		document.getElementById("GetNotPass").style.display="none";

		return false;

	}

	/* if the e-mail address is at an IP address (as opposed to a symbolic

	host name) make sure the IP address is valid. */

	var IPArray=domain.match(ipDomainPat);

	if (IPArray!=null)

	{

		// this is an IP address

		for (var i=1;i<=4;i++)

		{

			if (IPArray[i]>255)

			{

				//////alert("Destination IP address is invalid!");

				document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Destination IP address is invalid!</font>";

				document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Destination IP address is invalid!</font>";

				document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Destination IP address is invalid!</font>";

				document.getElementById("Forgot_Username").style.display="none";

				document.getElementById("ForgotMailError").style.display="none";

				document.getElementById("ForgotMailError2").style.display="none";

				document.getElementById("GetPass").style.display="none";

				document.getElementById("GetNotPass").style.display="none";

				return false;

		   }

		}

		return true;

	}

	// Domain is symbolic name.  Check if it's valid.

	var atomPat=new RegExp("^" + atom + "$");

	var domArr=domain.split(".");

	var len=domArr.length;

	

	for (i=0;i<len;i++)

	{

		if (domArr[i].search(atomPat)==-1)

		{

			//////alert("The Domain Name does not seem to be valid.");

			document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>The Domain Name does not seem to be valid</font>";

			document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>The Domain Name does not seem to be valid</font>";

			document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>The Domain Name does not seem to be valid</font>";

			document.getElementById("Forgot_Username").style.display="none";

			document.getElementById("ForgotMailError").style.display="none";

			document.getElementById("ForgotMailError2").style.display="none";

			document.getElementById("GetPass").style.display="none";

			document.getElementById("GetNotPass").style.display="none";

			return false;

		}

	}

	

	/* domain name seems valid, but now make sure that it ends in a

	known top-level domain (like com, edu, gov) or a two-letter word,

	representing country (uk, nl), and that there's a hostname preceding 

	the domain or country. */

	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1)

	{

		//////alert("The address must end in a well-known domain or two letter " + "country.");

		document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>The address must end in a well-known domain or &nbsp;&nbsp;&nbsp;two letter " + "country.</font>";

		document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>The address must end in a well-known domain or &nbsp;&nbsp;&nbsp;two letter " + "country.</font>";

		document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>The address must end in a well-known domain or two letter " + "country.</font>";

		document.getElementById("Forgot_Username").style.display="none";

		document.getElementById("ForgotMailError").style.display="none";

		document.getElementById("ForgotMailError2").style.display="none";

		document.getElementById("GetPass").style.display="none";

		document.getElementById("GetNotPass").style.display="none";

		return false;

	}

	// Make sure there's a host name preceding the domain.

	if (len<2)

	{

		//////alert("This address is missing a hostname!");

		document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This address is missing a hostname!</font>";

		document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This address is missing a hostname!</font>";

		document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>This address is missing a hostname!</font>";

		document.getElementById("Forgot_Username").style.display="none";

		document.getElementById("ForgotMailError").style.display="none";

		document.getElementById("ForgotMailError2").style.display="none";

		document.getElementById("GetPass").style.display="none";

		document.getElementById("GetNotPass").style.display="none";

		return false;

	}

return true;

}



function checkemail(Field)								

{

	var iChars = "!~`#$%&*!`~^+=[]\\\;/{}|\":<>?";

	for (var i = 0; i < Field.length; i++)

	{

		if (iChars.indexOf(Field.charAt(i)) != -1)

		{	

			//////alert("Special characters are not allowed")

			document.getElementById("mail_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Special characters are not allowed</font>";

			document.getElementById("Email_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Special characters are not allowed</font>";

			document.getElementById("ForgotMailError1").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Special characters are not allowed</font>";

			document.getElementById("Forgot_Username").style.display="none";

			document.getElementById("ForgotMailError").style.display="none";

			document.getElementById("ForgotMailError2").style.display="none";

			document.getElementById("GetPass").style.display="none";

			document.getElementById("GetNotPass").style.display="none";

			return false;

		}

	}

return true;

}



function charcheck(Field)						

{

	var iChars = "0123456789!~`@$%&*!`~^+=[]\\\;,:./{}|\"<>?";

    for (var i = 0; i < Field.length; i++)

	{

    	if (iChars.indexOf(Field.charAt(i)) != -1)

		{

			//////alert("Alphabets are not allowed");

				document.getElementById("city_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Characters only allowed</font>";

		document.getElementById("state_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Characters only allowed</font>";

		//document.getElementById("country_err").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>Characters only allowed</font>";

			return false;

		}

    }

	document.getElementById("city_err").style.display="none";

	document.getElementById("state_err").style.display="none";

	//document.getElementById("country_err").style.display="none";

return true;

}



/*function Numbersonly(v)

{

	var num=v.charAt(0);

	var numnext = v.charAt(1);

	//////alert(num);

	if((num==1) || (num==2) || (num==3) || (num==4) || (num==5) || (num==6) || (num==7) || (num==8))

	{

		document.getElementById("phoneno_err").innerHTML="Mobile number starts only in Zero OR Nine";

		return false;

	}

	else if((num!=1) && (numnext!=9))

	{

		//////alert(numnext);

		if((numnext==1) || (numnext==2) || (numnext==3) || (numnext==4) || (numnext==5) || (numnext==6) || (numnext==7) || (numnext==8))

		{

			document.getElementById("phoneno_err").innerHTML="Mobile number second value must starts in Nine";

			return false;

		}

	}

return true;

}*/



// Declaring required variables

var digits = "0123456789";

// non-digit characters which are allowed in phone numbers

var phoneNumberDelimiters = "()- ";

// characters which are allowed in international phone numbers

// (a leading + is OK)

var validWorldPhoneChars = phoneNumberDelimiters + "+";

// Minimum no of digits in an international phone no.

var minDigitsInIPhoneNumber = 10;



function isInteger(s)

{   var i;

    for (i = 0; i < s.length; i++)

    {   

        // Check that current character is number.

        var c = s.charAt(i);

        if (((c < "0") || (c > "9"))) return false;

    }

    // All characters are numbers.

    return true;

}

function trim(s)

{   var i;

    var returnString = "";

    // Search through string's characters one by one.

    // If character is not a whitespace, append to returnString.

    for (i = 0; i < s.length; i++)

    {   

        // Check that current character isn't whitespace.

        var c = s.charAt(i);

        if (c != " ") returnString += c;

    }

    return returnString;

}

function stripCharsInBag(s, bag)

{   var i;

    var returnString = "";

    // Search through string's characters one by one.

    // If character is not in bag, append to returnString.

    for (i = 0; i < s.length; i++)

    {   

        // Check that current character isn't whitespace.

        var c = s.charAt(i);

        if (bag.indexOf(c) == -1) returnString += c;

    }

    return returnString;

}



function checkInternationalPhone(strPhone){

var bracket=3

strPhone=trim(strPhone)

if(strPhone.indexOf("+")>1) return false

if(strPhone.indexOf("-")!=-1)bracket=bracket+1

if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket)return false

var brchr=strPhone.indexOf("(")

if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+2)!=")")return false

if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false

s=stripCharsInBag(strPhone,validWorldPhoneChars);

return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);

}



/*function ValidateForm(){

	var Phone=document.frmSample.txtPhone

	

	if ((Phone.value==null)||(Phone.value=="")){

		////alert("Please Enter your Phone Number")

		Phone.focus()

		return false

	}

	if (checkInternationalPhone(Phone.value)==false){

		////alert("Please Enter a Valid Phone Number")

		Phone.value=""

		Phone.focus()

		return false

	}

	return true

 }*/



function checkspecial(Field)								

{

	var iChars = "!~`@$%&*!`~^+=[]\\\;/{}|\"<>?";

	            

	for (var i = 0; i < Field.length; i++)

	{

		if (iChars.indexOf(Field.charAt(i)) != -1)

		{	

			//////alert("Special characters are not allowed")

			document.getElementById("address").innerHTML="Special characters are not allowed";

			return false;

		}

	}

return true;

}



function checkspecialShipping(Field)								

{

	var iChars = "!~`@$%&*!`~^+=[]\\\;/{}|\"<>?";

	            

	for (var i = 0; i < Field.length; i++)

	{

		if (iChars.indexOf(Field.charAt(i)) != -1)

		{	

			//////alert("Special characters are not allowed")

			document.getElementById("shippingaddress_err").innerHTML="Special characters are not allowed";

			return false;

		}

	}

return true;

}





function checkemailavailablity(email)

{

	try {

		//var email=document.getElementById('email').value;

		////alert(email);

	    var url = 'includes/email.availability.php?emailvalue='+email;

	    /////alert(url);

	    xmlCheckEmailHttp=GetXmlHttpObject();

	    xmlCheckEmailHttp.onreadystatechange=stateCheckEmail;

		xmlCheckEmailHttp.open("post",url,true);

	    xmlCheckEmailHttp.send(null);

	  //document.getElementById("uname_err").innerHTML="<img src=images/ajax-loader.gif>";

	} catch(e) {

	//alert(e.discription);

	}

}



function stateCheckEmail()	

{

if (xmlCheckEmailHttp.readyState==4 || xmlCheckEmailHttp.readyState=="complete")

	{ 

	//document.getElementById("email_err").innerHTML=xmlCheckEmailHttp.responseText

	var result1= xmlCheckEmailHttp.responseText;

	////alert(result1);

		

		/*if(result1=="notavailable") {

		//document.getElementById("mail_err").innerHTML="EmailId Not Available";

					//document.getElementById("RegisterDiv").style.display = "none";

					//addNavigation('ShowRoom');

					//LogUser();

		} */

			 if(result1=="EmailId Already Exits"){

					document.getElementById("changemail").innerHTML="<font style='font-family:Verdana; font-weight:normal; font-size:11px; color:#FF0000'>EmailID already exist asdfasfd</font>";

					document.getElementById('changemail').style.display="inline";

					document.getElementById("mail_err").style.display="none";

					document.getElementById("Email_err").style.display="none";

					//document.getElementById("mail").value="";

				} else {

					document.getElementById("changemail").innerHTML="";

					document.getElementById('errpass').style.display="none";

					document.getElementById("changemail").style.display="none";

					document.getElementById("mail_err").style.display="none";

					document.getElementById("Email_err").style.display="none";

				}

				

	}

}



/*function reg_val(uname)

{

	//var uname=document.getElementById('uname').value;

	////alert(uname);

	if(uname=="")

	{

		document.getElementById("uname_err").innerHTML="<img src=images/delete.png>";

	}

	else

	{

		//checkUserAvailability(uname,'');

		document.getElementById("uname_err").innerHTML="";

	}

}*/



/*function reg_val1(pass)

{

	

	//var pass=document.getElementById('pass').value;

	//alert(pass);

	if(pass=="")

	{

		document.getElementById("pass_err").innerHTML="<img src=images/delete.png>";

		

	}

	else if(pass.length<4)

	{

		

		document.getElementById("pass_err").innerHTML="<font color='red'>minimum 4 <font>";

		document.getElementById('pass').value="";

	}

	else

	{

		document.getElementById("pass_err").innerHTML="";

	}

}



function reg_val2(cpass)

{	

	//var cpass=document.getElementById('cpass').value;

	//alert(cpass);

	var pass=document.getElementById('pass').value;

	if(cpass=="")

	{

		document.getElementById("cpass_err").innerHTML="<img src=images/delete.png>";

	}

	else if(pass!=cpass)

	{

		

        ////alert("hai");

        document.getElementById("cpass_err").innerHTML="<font color='red'><font>";

		document.getElementById('cpass').value="";

	}

	else

	{

		document.getElementById("cpass_err").innerHTML="";

	}

}*/



/*function reg_val3(email)

{

	////alert(email);

	var email=document.getElementById('mail').value;

	 var mail_id=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

	if(email=="")

	{

		document.getElementById("mail_err").innerHTML="<img src=images/delete.png>";

	}

	else if(!email.match(mail_id)) 

    {

 		document.getElementById("mail_err").innerHTML="<font color='red'>Invalid Mail id<font>";

   		return true;

 	} 

	else

	{

		//checkUserAvailability('',email);

		document.getElementById("mail_err").innerHTML="";

		

	}

}*/



// Register validation completed





function FillCountry(cboCountry, cboState, sDefaultCountry)

{

	var sDefaultCountry, sDefault, sCountry



	cboCountry.options[0].length=0

    for(i=1;i<sCountryString.split("|").length;i++)

	{

		sCountry = sCountryString.split("|")[i];

        if (sDefaultCountry == sCountry)

		{

			sDefault=true;

            if (navigator.appName=="Microsoft Internet Explorer")

			{cboState.focus();

			}

		}

		else {sDefault=false;}



		if (sDefault)

		{

			cboCountry.options[i]=new Option(sCountry,sCountry,sDefault,sDefault);

		}

		else

		{

			cboCountry.options[i]=new Option(sCountryString.split("|")[i]);

		}

	}

}

if (navigator.appName=="Netscape")

{

isNav=true

}





var menu3=new Array()



menu3[0]='<a href="showthread1.php" class=\"menu\">1.The Benefits of a Good Shower </a>';

menu3[1]='<a href="showthread2.php" class=\"menu\">2.About Showerheads & Which one is Right for You</a>';

menu3[2]='<a href="showthread3.php" class=\"menu\">3.Handheld or Wall-mounted Showerhead</a>';

menu3[3]='<a href="showthread4.php" class=\"menu\">4.Showerhead Spray Types and their Unique Uses</a>';

menu3[4]='<a href="showthread5.php" class=\"menu\">5.Materials of Construction of Showerheads</a>';

menu3[5]='<a href="showthread6.php" class=\"menu\">6.How to install a showerhead</a>';

menu3[6]='<a href="showthread7.php" class=\"menu\">7.Poor water pressure and your showerhead</a>';

menu3[7]='<a href="showthread8.php" class=\"menu\">8.How to Clean Your Clogged Shower Head</a>';

menu3[8]='<a href="showthread9.php" class=\"menu\">9.How to Fix a Leaky Showerhead</a>';

menu3[9]='<a href="showthread10.php" class=\"menu\">10.Varying Water Temperatures</a>';

menu3[10]='<a href="bestsellers.php" class=\"menu\">11.Best Sellers</a>';

/*var menu4=new Array()



menu4[0]='<a href=\"javascript:void(0)\" onclick=\"javascript:addNavigation(\'ShowThread9\');\" class=\"menu\">Rate your favorite Bath/Body products or post your tips</a>';*/



var menuwidth='140px' //default menu width

var menubgcolor='#A62900'//menu bgcolor

var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)

var hidemenu_onclick="yes" //hide menu when user clicks within menu?



/////No further editting needed



var ie4=document.all

var ns6=document.getElementById&&!document.all



if (ie4||ns6)

document.write('<div id="dropmenudiv" style="visibility:hidden;" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){

var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;

var parentEl=what.offsetParent;

while (parentEl!=null){

totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;

parentEl=parentEl.offsetParent;

}

return totaloffset;

}





function showhide(obj, e, visible, hidden, menuwidth){

if (ie4||ns6)

dropmenuobj.style.left=dropmenuobj.style.top="-500px"

if (menuwidth!=""){

dropmenuobj.widthobj=dropmenuobj.style

dropmenuobj.widthobj.width=menuwidth

}

if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")

obj.visibility=visible

else if (e.type=="click")

obj.visibility=hidden

}



function iecompattest(){

return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body

}



function clearbrowseredge(obj, whichedge){

var edgeoffset=0

if (whichedge=="rightedge"){

var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15

dropmenuobj.contentmeasure=dropmenuobj.offsetWidth

if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)

edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth

}

else{

var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset

var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18

dropmenuobj.contentmeasure=dropmenuobj.offsetHeight

if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?

edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight

if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?

edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge

}

}

return edgeoffset

}



function populatemenu(what){

if (ie4||ns6)

dropmenuobj.innerHTML=what.join("")

}





function dropdownmenu(obj, e, menucontents, menuwidth){

if (window.event) event.cancelBubble=true

else if (e.stopPropagation) e.stopPropagation()



clearhidemenu()



dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv

populatemenu(menucontents)



if (ie4||ns6){

showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)



dropmenuobj.x=getposOffset(obj, "left")

dropmenuobj.y=getposOffset(obj, "top")

dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"

dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"

}



return clickreturnvalue()

}



function clickreturnvalue(){

if (ie4||ns6) return false

else return true

}

var a=null;

var b=null;

function contains_ns6(a, b) {

while (b.parentNode)

if ((b = b.parentNode) == a)

return true;

return false;

}



function dynamichide(e){

if (ie4&&!dropmenuobj.contains(e.toElement))

delayhidemenu()

else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))

delayhidemenu()

}



function hidemenu(e){

if (typeof dropmenuobj!="undefined"){

if (ie4||ns6)

dropmenuobj.style.visibility="hidden"

}

}



function delayhidemenu(){

if (ie4||ns6)

delayhide=setTimeout("hidemenu()",disappeardelay)

}



function clearhidemenu(){

if (typeof delayhide!="undefined")

clearTimeout(delayhide)

}



if (hidemenu_onclick=="yes")

document.onclick=hidemenu



var r={'special':/[\W]/g}

function valid(o,w) {

o.value = o.value.replace(r[w],'');

}











//## Rating javascript starts here ##//



<!-- Script for rating mouseover and mouseout starts -->

     function selstar(val)

      {

	for(var x=1;x<=val;x++)

	{

		document['i'+x].src="images/star2.gif";

	}

	

      }

      function remstar(val)

      {

	for(var x=1;x<=val;x++)

	{

		document['i'+x].src="images/star1.gif";

	}

      }



     // function setrate(val)

     // {

	/*document.getElementById('').value=val;*/

/*	document.rate.submit();*/

       //  alert(val);

     // }

<!-- Script for rating mouseover and mouseout ends here -->









function setrate(rate)

{

    //alert(rate);

  //alert(pid);

	//var Sdate=document.dispute.hid_date.value;

	//var Prodid=pid;

	//alert(rate);

	Rate_Type=rate;

	

		//alert(+","+ProductId+","+SenderId+","+Rate_Type+","+item_value+","+Com_value+","+Speed_value,Feed_Back);

	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null)

	{

		alert ("Browser does not support HTTP Request");

		return;

	} 

	var url;

   //url="showdetails.php?from=rating&ratevalue="+Rate_Type+"&prodid="+Prodid;

     url="showdetails.php?ratevalue="+Rate_Type;	 /*url="showdetail.php?form=rating&uid="+ReceiverId+"&pid="+ProductId+"&type="+Rate_Type+"&item="+item_value+"&commun="+Com_value+"&speed="+Speed_value+"&feed="+Feed_Back+"&sd="+Sdate;			*/	

	//alert (url);

	//url=url+"&amp;sid="+Math.random()

	xmlHttp.onreadystatechange=Rating_State ;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}



function Rating_State() 

{ 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

	{ 	

	//document.getElementById('test').innerHTML=xmlHttp.responseText;

	if(Rate_Type==1)

	{

	document.getElementById('show1').style.display="block";

	document.getElementById('star').style.display="none";

	document.getElementById('textarea_review').focus();

	}

	if(Rate_Type==2)

	{

	document.getElementById('show2').style.display="block";

	document.getElementById('star').style.display="none";

	document.getElementById('textarea_review').focus();

	}

	if(Rate_Type==3)

	{

	document.getElementById('show3').style.display="block";

	document.getElementById('star').style.display="none";

	document.getElementById('textarea_review').focus();

	}

	if(Rate_Type==4)

	{

	document.getElementById('show4').style.display="block";

	document.getElementById('star').style.display="none";

	document.getElementById('textarea_review').focus();

	}

	if(Rate_Type==5)

	{

	document.getElementById('show5').style.display="block";

	document.getElementById('star').style.display="none";

	document.getElementById('textarea_review').focus();

	}

		sfeed = xmlHttp.responseText.split("~~");

		if(sfeed[0]=="fail")

		{

			alert("Your already rated for this product...");

		}

//		

//		document.dispute.feedback.value=sfeed[0];

//		alert("Chk Success");

        

		//location.reload();

		//alert("Thank u for ur rating");

	} 

}

function notlogedin()

{

	alert("please login to Rate and Review the Product");

    window.location="login.php";

}

function review(pid)

{



  //alert(pid);

	//var Sdate=document.dispute.hid_date.value;



	var Prodid=pid;

	

	if(document.getElementById('textarea_review').value=="")

	{

		alert("Please give comments for review");

		document.getElementById('textarea_review').focus();

        return false;

	}

	var reviewcomments;

	reviewcomments=document.getElementById('textarea_review').value;

		//alert(+","+ProductId+","+SenderId+","+Rate_Type+","+item_value+","+Com_value+","+Speed_value,Feed_Back);

	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null)

	{

		alert ("Browser does not support HTTP Request");

		return;

	} 

	var url;

   url="showdetails.php?from=review&prodid="+Prodid+"&rvalue="+Rate_Type+"&reviewcomments="+reviewcomments;	/*url="showdetail.php?form=rating&uid="+ReceiverId+"&pid="+ProductId+"&type="+Rate_Type+"&item="+item_value+"&commun="+Com_value+"&speed="+Speed_value+"&feed="+Feed_Back+"&sd="+Sdate;			*/	

	//alert (url);

	//url=url+"&amp;sid="+Math.random()

	xmlHttp.onreadystatechange=review_Changed ;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}



function review_Changed() 

{ 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

	{ 	

	//document.getElementById('test').innerHTML=xmlHttp.responseText;

		sfeed = xmlHttp.responseText.split("~~");

		if(sfeed[0]=="fail")

		{

			alert("Your already rated for this product...");

			return false;

		}

//		

//		document.dispute.feedback.value=sfeed[0];

//		alert("Chk Success");

        

	      location.reload();

		alert("Thank u for ur review");

	} 

}



function GetXmlHttpObject()

{ 

var objXMLHttp=null;

try 

{ 

	return new ActiveXObject("Msxml2.XMLHTTP"); 

} 

catch (e) 

{

}

try 

{ 

	return new ActiveXObject("Microsoft.XMLHTTP"); 

} 

catch (e) 

{

}

try 

{ 

	return new XMLHttpRequest(); 

} 

catch(e) 

{

}

//objXMLHttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");



return objXMLHttp;

}

//## Rating javascript ends here ##//