var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
}

function ValidateUsername(user,id)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=UsernameValidation&name=" + user + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(id).innerHTML = http.responseText;
	  }
  }
  http.send(null);
}
function ValidatePassword(pass,id)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=PasswordValidation&password=" + pass + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(id).innerHTML = http.responseText;
	  }
  }
  http.send(null);
}
function ValidateEmail(email,id,fieldid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=NewsletterValidation&email=" + email + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  //document.getElementById(id).innerHTML = http.responseText;
		  if(http.responseText=="No")
		  {
				document.getElementById(id).innerHTML = "You already subscribed.";
				alert("You already subscribed.");
				document.getElementById(fieldid).value="";
				document.getElementById(fieldid).focus();
		  }
	  }
  }
  http.send(null);
}
function InsertNesletterEmail(email,id,fieldid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Add_Newsletter&email=" + email + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		 // document.getElementById(id).innerHTML = "<img src='images/loading_small.gif' border='0' align='center' />";
		  if(http.responseText=="Added")
		  {
				document.getElementById(id).innerHTML = "Thankyou for subscribing to Long Island Gourmet Newsletter.";
				//document.getElementById(fieldid).value="";
				//document.getElementById(fieldid).focus();
		  }
		  if(http.responseText=="No")
		  {
		  		document.getElementById(id).innerHTML = "You are already Subscribed !";
				//document.getElementById(fieldid).value="";
				//document.getElementById(fieldid).focus();
		  }
	  }
  }
  http.send(null);
}
function AddProduct(allfield,id,fieldid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Add_Product&email=" + allfield + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  //document.getElementById(id).innerHTML = http.responseText;
		  if(http.responseText=="Added")
		  {
				document.getElementById(id).innerHTML = "Thank you for subscribing.";
				document.getElementById(fieldid).value="";
				document.getElementById(fieldid).focus();
		  }
	  }
  }
  http.send(null);
}
/////////////////ADD TO CART PRODUCT/////////////
function AddtocartProduct(productid,quantity,id,fieldid,OrderImageId,Price,Producttype)
{
	//alert(id);
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Addtocart_Product&productid=" + productid + "&quantity=" + quantity +"&price=" + Price + "&producttype=" + Producttype + "&id=" + id, true);
  document.getElementById(id).innerHTML = "<img src='images/loading_small.gif' border='0' align='center' />";
  document.getElementById(OrderImageId).innerHTML = "<img src='images/loading_small.gif' border='0' align='center' />";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
			document.getElementById(id).innerHTML = http.responseText;
	  }
  }
  http.send(null);
}
/////////////////END ADD TO CART PRODUCT/////////////
function FrmCheckAddtoCart(Productid,CartDisplayId,OrderImageId,Quantity,Price,Producttype)
{
	if(Quantity=="")
	{
		alert("Quantity can not be blank");	
		return false;
	}
	else
	{
		AddtocartProduct(Productid,Quantity,CartDisplayId,'newsletteremail',OrderImageId,Price,Producttype);
		document.getElementById(OrderImageId).innerHTML="<span class=\"red_20\"><img src=\"images/added.jpg\" alt=\"Added\" width=\"94\" height=\"31\" border=\"0\" align=\"middle\"/></span>";
		return true;
	}
}
///Check top login detail

///End of Check top login detail

///////Registration Process email address exist checking
function ValidateEmail_Register(email,id,fieldid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=ValidateEmail_Register&email=" + email + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  //document.getElementById(id).innerHTML = http.responseText;
		  if(http.responseText=="No")
		  {
				document.getElementById(id).innerHTML = "Email address already exists.";
				//alert("Email address already exists.");
				document.getElementById(fieldid).value="";
				document.getElementById(fieldid).focus();
		  }
	  }
  }
  http.send(null);
}
///////Registration Process email address exist checking
function ValidateEmail_Register_Edit(email,id,fieldid,Editid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=ValidateEmail_Register_Edit&email=" + email + "&Editid=" + Editid + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  //document.getElementById(id).innerHTML = http.responseText;
		  if(http.responseText=="No")
		  {
				document.getElementById(id).innerHTML = "Email address already exists.";
				//alert("Email address already exists.");
				document.getElementById(fieldid).value="";
				document.getElementById(fieldid).focus();
		  }
		  else
		  {
			  document.getElementById(id).innerHTML = "&nbsp;";
		  }
	  }
  }
  http.send(null);
}
///////Registration Process email address exist checking

///////Registration Detail adding
function InsertRegistrationDetail(username,password,contact_name,billing_name,email,billing_address1,billing_address2,billing_city,billing_country,billing_state,billing_zip,phone1,phone2,fax,id)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=InsertRegistrationDetail&username=" + username + "&password=" + password + "&contact_name=" + contact_name + "&billing_name=" + billing_name + "&email=" + email + "&billing_address1=" + billing_address1 + "&billing_address2=" + billing_address2 + "&billing_city=" + billing_city + "&billing_country=" + billing_country + "&billing_state=" + billing_state + "&billing_zip=" + billing_zip + "&phone1=" + phone1 + "&phone2=" + phone2 + "&fax=" + fax + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  //document.getElementById(id).innerHTML = http.responseText;
		  if(http.responseText=="Added")
		  {
				document.getElementById(id).innerHTML = "Thankyou for subscribing.";
				document.FrmRegister.reset();
		  }
	  }
  }
  http.send(null);
}

/////////Check Forgot pass email
function Forgotpassemail_check(email,id,fieldid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Forgotpassemail_check&email=" + email + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  //document.getElementById(id).innerHTML = http.responseText;
		  if(http.responseText=="No")
		  {
				document.getElementById(id).innerHTML = "Email address does not exists.";
				//alert("Email address already exists.");
				document.getElementById(fieldid).value="";
				document.getElementById(fieldid).focus();
		  }
		  if(http.responseText=="Yes")
		  {
				document.getElementById(id).innerHTML = "Password has been sent at your email address. Please cheack your mail.";
				document.getElementById(fieldid).value="";
				document.getElementById(fieldid).focus();
		  }
	  }
  }
  http.send(null);
}
function keycode_products(pval)
{
   var frm_v = document.FrmProducts;
   var qvals= eval("frm_v.quantity" + pval);
 /*  if(eval("frm_v.quantity" + pval).value == "")
   {
		alert("Quantity can not be blank");
		eval("frm_v.quantity" + pval).focus(); 
		return false;
   }*/
   if(eval("frm_v.quantity" + pval).value == "0")
   {
		//alert("Quantity must be greter than zero");
		eval("frm_v.quantity" + pval).value="";
		eval("frm_v.quantity" + pval).focus();
		return false;
   }
   if(eval("frm_v.quantity" + pval).value < 0)
   {
		//alert("Quantity can not be less than zero");
		eval("frm_v.quantity" + pval).value="";
		eval("frm_v.quantity" + pval).focus();
		return false;
   }
   if(isNaN(eval("frm_v.quantity" + pval).value))
   {
		//alert("Invalied quantity.");
		eval("frm_v.quantity" + pval).value="";
		eval("frm_v.quantity" + pval).focus();
		return false;
   }
}
function keycode_products_detail()
{
   var frm_v = document.FrmProducts;
   if(eval("frm_v.quantity").value == 0)
   {
		//alert("Quantity must be greter than zero");
		eval("frm_v.quantity").value="";
		eval("frm_v.quantity").focus();
		return false;
   }
   if(eval("frm_v.quantity").value < 0)
   {
		//alert("Quantity can not be less than zero");
		eval("frm_v.quantity").value="";
		eval("frm_v.quantity").focus();
		return false;
   }
   if(isNaN(eval("frm_v.quantity").value))
   {
		//alert("Invalied quantity.");
		eval("frm_v.quantity").value="";
		eval("frm_v.quantity").focus();
		return false;
   }
 
}
///////Registration Process email address exist checking
///////////////trailer Opening/////////
function popTrailer(file)
{
  var URL = "http://trailers.mallcom.com/?open="+ file;
  window.open(URL,'trailer','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=410,height=400,top=100,left=300');
}
///////////////trailer Opening/////////

function Load_NewRelease_Gay(Load_NewRelease_Gay_ID,Curdate)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_NewRelease_Gay&Curdate=" + Curdate, true);
  document.getElementById(Load_NewRelease_Gay_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_NewRelease_Gay_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Studio_Gay(Load_Studio_Gay_ID,Studio)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Studio_Gay&Studio=" + Studio, true);
  document.getElementById(Load_Studio_Gay_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Studio_Gay_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Category_Search(Load_Category_Search_ID,Genre,Cat)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Category_Search&Genre=" + Genre +"&Cat=" + Cat, true);
  document.getElementById(Load_Category_Search_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Category_Search_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Star_Search(Load_Star_Search_ID,Star,Cat)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Star_Search&Star=" + Star +"&Cat=" + Cat, true);
  document.getElementById(Load_Star_Search_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Star_Search_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_NewRelease(Load_NewRelease_ID,releaseon,Cat)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_NewRelease&releaseon=" + releaseon+ "&Cat=" + Cat, true);
  document.getElementById(Load_NewRelease_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_NewRelease_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Category(Load_Category_ID,Genre,Cat)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Category&Genre=" + Genre+"&Cat=" + Cat, true);
  document.getElementById(Load_Category_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Category_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Director(Load_Director_ID,Director,Cat)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Director&Director=" + Director +"&Cat=" + Cat, true);
  document.getElementById(Load_Director_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Director_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Studio(Load_Studio_ID,Studio,Cat)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Studio&Studio=" + Studio + "&Cat=" + Cat, true);
  document.getElementById(Load_Studio_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Studio_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Studio_Advance(Load_Studio_Advance_ID,Studio)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Studio_Advance&Studio=" + Studio, true);
  document.getElementById(Load_Studio_Advance_ID).innerHTML = "<select name='temp' style='width:180px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Studio_Advance_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Star_Advance(Load_Star_Advance_ID,Star)
{
  var http2 = false;

	if(navigator.appName == "Microsoft Internet Explorer") {
	  http2 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http2 = new XMLHttpRequest();
	}
  http2.abort();
  http2.open("GET", "ajax_validation.php?Type=Load_Star_Advance&Star=" + Star, true);
  document.getElementById(Load_Star_Advance_ID).innerHTML = "<select name='temp' style='width:180px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http2.onreadystatechange=function()
  {
	  if(http2.readyState == 4)
	  {
		  document.getElementById(Load_Star_Advance_ID).innerHTML= http2.responseText;
	  } 
  }
  http2.send(null);
}
function Load_Director_Advance(Load_Director_Advance_ID,Director)
{
  var http3 = false;

	if(navigator.appName == "Microsoft Internet Explorer") {
	  http3 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http3 = new XMLHttpRequest();
	}
  http3.abort();
  http3.open("GET", "ajax_validation.php?Type=Load_Director_Advance&Director=" + Director, true);
  document.getElementById(Load_Director_Advance_ID).innerHTML = "<select name='temp' style='width:180px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http3.onreadystatechange=function()
  {
	  if(http3.readyState == 4)
	  {
		  document.getElementById(Load_Director_Advance_ID).innerHTML= http3.responseText;
	  } 
  }
  http3.send(null);
}
function Load_Category_Advance(Load_Category_Advance_ID,Category)
{
  var http4 = false;

	if(navigator.appName == "Microsoft Internet Explorer") {
	  http4 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http4 = new XMLHttpRequest();
	}
  http4.abort();
  http4.open("GET", "ajax_validation.php?Type=Load_Category_Advance&Category=" + Category, true);
  document.getElementById(Load_Category_Advance_ID).innerHTML = "<select name='temp' style='width:180px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http4.onreadystatechange=function()
  {
	  if(http4.readyState == 4)
	  {
		  document.getElementById(Load_Category_Advance_ID).innerHTML= http4.responseText;
	  } 
  }
  http4.send(null);
}
/*function Load_Studio(Load_Studio_ID,Studio)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Studio&Studio=" + Studio, true);
  document.getElementById(Load_Studio_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Studio_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}*/
function Load_Index_Latestdvd(Load_Index_Latestdvd_ID)
{
  var http1 = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http1 = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http1 = new XMLHttpRequest();
}
  http1.abort();
  http1.open("GET", "ajax_validation.php?Type=Load_Index_Latestdvd", true);
  document.getElementById(Load_Index_Latestdvd_ID).innerHTML = "<img src='images/loading.gif'>";
  http1.onreadystatechange=function()
  {
	  if(http1.readyState == 4)
	  {
		  document.getElementById(Load_Index_Latestdvd_ID).innerHTML= http1.responseText;
	  } 
  }
  http1.send(null);
}
function Load_Index_HotestAdulttoys(Load_Index_HotestAdulttoys_ID)
{
  var http2 = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http2 = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http2 = new XMLHttpRequest();
}
  http2.abort();
  http2.open("GET", "ajax_validation.php?Type=Load_Index_HotestAdulttoys", true);
  document.getElementById(Load_Index_HotestAdulttoys_ID).innerHTML = "<img src='images/loading.gif'>";
  http2.onreadystatechange=function()
  {
	  if(http2.readyState == 4)
	  {
		  document.getElementById(Load_Index_HotestAdulttoys_ID).innerHTML= http2.responseText;
	  } 
  }
  http2.send(null);
}
function Load_Index_Preorder(Load_Index_Preorder_ID)
{
 var http3 = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http3 = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http3 = new XMLHttpRequest();
}
 http3.abort();
  http3.open("GET", "ajax_validation.php?Type=Load_Index_Preorder", true);
  document.getElementById(Load_Index_Preorder_ID).innerHTML = "<img src='images/loading.gif'>";
  http3.onreadystatechange=function()
  {
	  if(http3.readyState == 4)
	  {
		  document.getElementById(Load_Index_Preorder_ID).innerHTML= http3.responseText;
	  } 
  }
  http3.send(null);
}
function Load_Index_LatestGayDvd(Load_Index_LatestGayDvd_ID)
{
  var http4 = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http4 = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http4 = new XMLHttpRequest();
}
  http4.abort();
  http4.open("GET", "ajax_validation.php?Type=Load_Index_LatestGayDvd", true);
  document.getElementById(Load_Index_LatestGayDvd_ID).innerHTML = "<img src='images/loading.gif'>";
  http4.onreadystatechange=function()
  {
	  if(http4.readyState == 4)
	  {
		  document.getElementById(Load_Index_LatestGayDvd_ID).innerHTML= http4.responseText;
	  } 
  }
  http4.send(null);
}

function Load_Right_Top10movietrailer(Load_Right_Top10movietrailer_ID1)
{
	  var http5 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http5 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http5 = new XMLHttpRequest();
	}
  http5.abort();
  http5.open("GET", "ajax_validation.php?Type=Load_Right_Top10movietrailer", true);
  document.getElementById(Load_Right_Top10movietrailer_ID1).innerHTML = "<img src='images/loading.gif'>";
  http5.onreadystatechange=function()
  {
	  if(http5.readyState == 4)
	  {
		  document.getElementById(Load_Right_Top10movietrailer_ID1).innerHTML= http5.responseText;
	  } 
  }
  http5.send(null);
}
function Load_Right_Top10Toys(Load_Right_Top10Toys_ID)
{
	  var http6 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http6 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http6 = new XMLHttpRequest();
	}
  http6.abort();
  http6.open("GET", "ajax_validation.php?Type=Load_Right_Top10Toys", true);
  document.getElementById(Load_Right_Top10Toys_ID).innerHTML = "<img src='images/loading.gif'>";
  http6.onreadystatechange=function()
  {
	  if(http6.readyState == 4)
	  {
		  document.getElementById(Load_Right_Top10Toys_ID).innerHTML= http6.responseText;
	  } 
  }
  http6.send(null);
}
function Load_Right_Top10BestSellingDvd(Load_Right_Top10BestSellingDvd_ID)
{
	  var http7 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http7 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http7 = new XMLHttpRequest();
	}
  http7.abort();
  http7.open("GET", "ajax_validation.php?Type=Load_Right_Top10BestSellingDvd", true);
  document.getElementById(Load_Right_Top10BestSellingDvd_ID).innerHTML = "<img src='images/loading.gif'>";
  http7.onreadystatechange=function()
  {
	  if(http7.readyState == 4)
	  {
		  document.getElementById(Load_Right_Top10BestSellingDvd_ID).innerHTML= http7.responseText;
	  } 
  }
  http7.send(null);
}
function Load_Right_Top10Pornstar(Load_Right_Top10Pornstar_ID)
{
	  var http8 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http8 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http8 = new XMLHttpRequest();
	}
  http8.abort();
  http8.open("GET", "ajax_validation.php?Type=Load_Right_Top10Pornstar", true);
  document.getElementById(Load_Right_Top10Pornstar_ID).innerHTML = "<img src='images/loading.gif'>";
  http8.onreadystatechange=function()
  {
	  if(http8.readyState == 4)
	  {
		  document.getElementById(Load_Right_Top10Pornstar_ID).innerHTML= http8.responseText;
	  } 
  }
  http8.send(null);
}
function Load_Right_Top5Clothing(Load_Right_Top5Clothing_ID)
{
	var http9 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http9 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http9 = new XMLHttpRequest();
	}
  http9.abort();
  http9.open("GET", "ajax_validation.php?Type=Load_Right_Top5Clothing", true);
  document.getElementById(Load_Right_Top5Clothing_ID).innerHTML = "<img src='images/loading.gif'>";
  http9.onreadystatechange=function()
  {
	  if(http9.readyState == 4)
	  {
		  document.getElementById(Load_Right_Top5Clothing_ID).innerHTML= http9.responseText;
	  } 
  }
  http9.send(null);
}
function Load_Right_Top5Vitamins(Load_Right_Top5Vitamins_ID)
{
	var http10 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http10 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http10 = new XMLHttpRequest();
	}
  http10.abort();
  http10.open("GET", "ajax_validation.php?Type=Load_Right_Top5Vitamins", true);
  document.getElementById(Load_Right_Top5Vitamins_ID).innerHTML = "<img src='images/loading.gif'>";
  http10.onreadystatechange=function()
  {
	  if(http10.readyState == 4)
	  {
		  document.getElementById(Load_Right_Top5Vitamins_ID).innerHTML= http10.responseText;
	  } 
  }
  http10.send(null);
}
function Load_Left_Top10Studio(Load_Left_Top10Studio_ID)
{
	var http11 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http11 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http11 = new XMLHttpRequest();
	}
  http11.abort();
  http11.open("GET", "ajax_validation.php?Type=Load_Left_Top10Studio", true);
  document.getElementById(Load_Left_Top10Studio_ID).innerHTML = "<img src='images/loading.gif'>";
  http11.onreadystatechange=function()
  {
	  if(http11.readyState == 4)
	  {
		  document.getElementById(Load_Left_Top10Studio_ID).innerHTML= http11.responseText;
	  } 
  }
  http11.send(null);
}

function Load_Prepack_Items(Load_Prepack_Items_ID,prepackid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Prepack_Items&prepackid=" + prepackid, true);
  document.getElementById(Load_Prepack_Items_ID).innerHTML = "<img src='images/loading.gif'>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Prepack_Items_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_Studio_POP(Load_Studio_POP_ID,Studio)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Studio_POP&Studio=" + Studio, true);
  document.getElementById(Load_Studio_POP_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Studio_POP_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
function Load_POP_Category(Load_POP_Category_ID,Category)
{
  var http2 = false;

	if(navigator.appName == "Microsoft Internet Explorer") {
	  http2 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http2 = new XMLHttpRequest();
	}

  http2.abort();
  http2.open("GET", "ajax_validation.php?Type=Load_POP_Category&Category=" + Category, true);
  document.getElementById(Load_POP_Category_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http2.onreadystatechange=function()
  {
	  if(http2.readyState == 4)
	  {
		  document.getElementById(Load_POP_Category_ID).innerHTML= http2.responseText;
	  } 
  }
  http2.send(null);
}

function ShippingMethoadChange(ShippingMethoadChange_ID,ShippingMethoad,Finaltotal_ID)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=ShippingMethoadChange&ShippingMethoad=" + ShippingMethoad, true);
  document.getElementById(ShippingMethoadChange_ID).innerHTML = "";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  var aa,bb;
		  aa=http.responseText;
		  bb=aa.split("###");
		  document.getElementById(ShippingMethoadChange_ID).innerHTML= bb[0];
		  document.getElementById(Finaltotal_ID).innerHTML= bb[1];
	  } 
  }
  http.send(null);
}

function PromocodeAppy(Promocode_ID,Promocode,Finaltotal_ID)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=PromocodeAppy&Promocode=" + Promocode, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		   if(http.responseText=="Invalied")
		   {
			   alert("Invalied Promotional code.");
		   }
		   else
		   {
			  var aa,bb;
			  aa=http.responseText;
			  bb=aa.split("###");
			  document.getElementById(Promocode_ID).innerHTML= bb[0];
			  document.getElementById(Finaltotal_ID).innerHTML= bb[1];
		   }
	  } 
  }
  http.send(null);
}
function Load_Category_Gay(Load_Category_Gay_ID,genres)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Category_Gay&genres=" + genres, true);
  document.getElementById(Load_Category_Gay_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Category_Gay_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}


function Load_Left_NewsFeeds(Load_Left_NewsFeeds_ID)
{
	var http11 = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http11 = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http11 = new XMLHttpRequest();
	}
  http11.abort();
  http11.open("GET", "ajax_validation.php?Type=Load_Left_NewsFeeds", true);
  document.getElementById(Load_Left_NewsFeeds_ID).innerHTML = "<img src='images/loading.gif'>";
  http11.onreadystatechange=function()
  {
	  if(http11.readyState == 4)
	  {
		  alert(http11.responseText);
		 document.getElementById(Load_Left_NewsFeeds_ID).innerHTML= http11.responseText;
	  } 
  }
  http11.send(null);
}

function Load_Star_Gay(Load_Star_Gay_ID,star)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=Load_Star_Gay&star=" + star, true);
  document.getElementById(Load_Star_Gay_ID).innerHTML = "<select name='temp' style='width:230px;text-decoration:blink;' disabled='disabled'><option value=''>Loading...</option></select>";
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  document.getElementById(Load_Star_Gay_ID).innerHTML= http.responseText;
	  } 
  }
  http.send(null);
}
///////Registration Process email address exist checking
function ValidateUsername_Register(username,id,fieldid)
{
  http.abort();
  http.open("GET", "ajax_validation.php?Type=ValidateUsername_Register&username=" + username + "&id=" + id, true);
  http.onreadystatechange=function()
  {
	  if(http.readyState == 4)
	  {
		  //document.getElementById(id).innerHTML = http.responseText;
		  if(http.responseText=="No")
		  {
				document.getElementById(id).innerHTML = "Login Username already exists.";
				//alert("Email address already exists.");
				document.getElementById(fieldid).value="";
				document.getElementById(fieldid).focus();
		  }
	  }
  }
  http.send(null);
}
