function checkColorOnly(prodID)
{
	if (document.productForm.thisProdColor.value==null||document.productForm.thisProdColor.value=="")
  	{
	  	alert("Please Select A Color");
	  	return false;
	}
	else
	{
		return true;
	}
}

function checkStyleOnly()
{
	if (document.productForm.thisProdStyle.value==null||document.productForm.thisProdStyle.value=="")
  	{
	  	alert("Please Select A Style");
	  	return false;
	}
	else
	{
		return true;
	}
}

function checkSizeOnly()
{
	if (document.productForm.thisProdSize.value==null||document.productForm.thisProdSize.value=="")
  	{
	  	alert("Please Select A Size");
	  	return false
	}
	else
	{
		return true
	}
}

function checkSizeColor()
{
	if (document.productForm.thisProdSize.value==null||document.productForm.thisProdSize.value==""||document.productForm.thisProdColor.value==null||document.productForm.thisProdColor.value=="")
	{

		if (document.productForm.thisProdSize.value==null||document.productForm.thisProdSize.value=="")
  		{
	  		error1="Please Select A Size";
		}
		else
		{
			error1="";
		}
		if (document.productForm.thisProdColor.value==null||document.productForm.thisProdColor.value=="")
		{
			error2="\n Please Select A Color";
		}
		else
		{
			error2="";
		}
		alert(error1 + error2);
		return false
	}
	else
	{
		return true
	}
}

function checkSizeStyle()
{
	if (document.productForm.thisProdSize.value==null||document.productForm.thisProdSize.value==""||document.productForm.thisProdStyle.value==null||document.productForm.thisProdStyle.value=="")
	{

		if (document.productForm.thisProdSize.value==null||document.productForm.thisProdSize.value=="")
  		{
	  		error1="Please Select A Size";
		}
		else
		{
			error1="";
		}
		if (document.productForm.thisProdStyle.value==null||document.productForm.thisProdStyle.value=="")
		{
			error2="\n Please Select A Style";
		}
		else
		{
			error2="";
		}
		alert(error1 + error2);
		return false
	}
	else
	{
		return true
	}
}

function checkColorStyle()
{
	if (document.productForm.thisProdColor.value==null||document.productForm.thisProdColor.value==""||document.productForm.thisProdStyle.value==null||document.productForm.thisProdStyle.value=="")
	{

		if (document.productForm.thisProdColor.value==null||document.productForm.thisProdColor.value=="")
  		{
	  		error1="Please Select A Color";
		}
		else
		{
			error1="";
		}
		if (document.productForm.thisProdStyle.value==null||document.productForm.thisProdStyle.value=="")
		{
			error2="\n Please Select A Style";
		}
		else
		{
			error2="";
		}
		alert(error1 + error2);
		return false
	}
	else
	{
		return true
	}
}

function checkSizeColorStyle()
{
	if (document.productForm.thisProdColor.value==null||document.productForm.thisProdColor.value==""||document.productForm.thisProdStyle.value==null||document.productForm.thisProdStyle.value==""||document.productForm.thisProdSize.value==null||document.productForm.thisProdSize.value=="")
	{

		if (document.productForm.thisProdColor.value==null||document.productForm.thisProdColor.value=="")
  		{
	  		error1="Please Select A Color";
		}
		else
		{
			error1="";
		}
		if (document.productForm.thisProdStyle.value==null||document.productForm.thisProdStyle.value=="")
		{
			error2="\n Please Select A Style";
		}
		else
		{
			error2="";
		}
		if (document.productForm.thisProdSize.value==null||document.productForm.thisProdSize.value=="")
		{
			error3="\n Please Select A Size";
		}
		else
		{
			error3="";
		}
		alert(error1 + error2 + error3);
		return false
	}
	else
	{
		return true
	}
}

function styleGetColor(selectedStyle,currentColor,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&style=" + selectedStyle + "&action=styleGetColor&currentColor=" + currentColor + "&setNumber=" + setNumber;
	number1=setNumber
	xmlHttp=GetXmlHttpObject(colorStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function styleGetColorSize(selectedStyle,currentColor,currentSize,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&style=" + selectedStyle + "&action=styleGetColorSize&currentColor=" + currentColor + "&currentSize=" + currentSize + "&setNumber=" + setNumber;
	number2=setNumber
	xmlHttp=GetXmlHttpObject(colorSizeStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function colorGetStyleSize(selectedColor,currentStyle,currentSize,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&color=" + selectedColor + "&action=colorGetStyleSize&currentStyle=" + currentStyle + "&currentSize=" + currentSize + "&setNumber=" + setNumber;
	number3=setNumber
	xmlHttp=GetXmlHttpObject(styleSizeStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function sizeGetStyleColor(selectedSize,currentStyle,currentColor,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&size=" + selectedSize + "&action=sizeGetStyleColor&currentStyle=" + currentStyle + "&currentColor=" + currentColor + "&setNumber=" + setNumber;
	number4=setNumber
	xmlHttp=GetXmlHttpObject(styleColorStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function colorGetStyle(selectedColor,currentStyle,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&color=" + selectedColor + "&action=colorGetStyle&currentStyle=" + currentStyle + "&setNumber=" + setNumber;
	number5=setNumber
	xmlHttp=GetXmlHttpObject(styleStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function sizeGetStyle(selectedSize,currentStyle,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&size=" + selectedSize + "&action=sizeGetStyle&currentStyle=" + currentStyle + "&setNumber=" + setNumber;
	number5=setNumber
	xmlHttp=GetXmlHttpObject(styleStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function styleGetSize(selectedStyle,currentSize,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&style=" + selectedStyle + "&action=styleGetSize&currentSize=" + currentSize + "&setNumber=" + setNumber;
	number6=setNumber
	xmlHttp=GetXmlHttpObject(sizeStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function colorGetSize(selectedColor,currentSize,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&color=" + selectedColor + "&action=colorGetSize&currentSize=" + currentSize + "&setNumber=" + setNumber;
	number6=setNumber
	xmlHttp=GetXmlHttpObject(sizeStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function sizeGetColor(selectedSize,currentColor,prodID,setNumber)
{
	var url="http://www.halloweenpartystore.com/optionAjax.php?prodID=" + prodID + "&size=" + selectedSize + "&action=sizeGetColor&currentColor=" + currentColor + "&setNumber=" + setNumber;
	number1=setNumber
	xmlHttp=GetXmlHttpObject(colorStateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
}

function colorStateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(number1 > 0)
		{
			var prodColorName="prodColor"+number1;
		}
		else
		{
			var prodColorName="prodColor";
		}
		var data = xmlHttp.responseText.split('||');
		document.getElementById(prodColorName).innerHTML = data[0];
		document.getElementById('schecker').innerHTML = data[1];
		
	}
}

function sizeStateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(number6 > 0)
		{
			var prodSizeName="prodSize"+number6;
		}
		else
		{
			var prodSizeName="prodSize";
		}
		
		var data = xmlHttp.responseText.split('||');
		document.getElementById(prodSizeName).innerHTML = data[0];
		document.getElementById('schecker').innerHTML = data[1];
		
		
	}
}

function colorSizeStateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(number2 > 0)
		{
			var prodColorName="prodColor"+number2;
			var prodSizeName="prodSize"+number2;
		}
		else
		{
			var prodColorName="prodColor";
			var prodSizeName="prodSize";
		}
		results = xmlHttp.responseText.split("||");
		document.getElementById(prodColorName).innerHTML = results[0];
		document.getElementById(prodSizeName).innerHTML = results[1];
	}
}

function styleSizeStateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(number3 > 0)
		{
			var prodStyleName="prodStyle"+number3;
			var prodSizeName="prodSize"+number3;
		}
		else
		{
			var prodStyleName="prodStyle";
			var prodSizeName="prodSize";
		}
		results = xmlHttp.responseText.split("||");
		document.getElementById(prodStyleName).innerHTML = results[0];
		document.getElementById(prodSizeName).innerHTML = results[1];
	}
}

function styleColorStateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(number4 > 0)
		{
			var prodStyleName="prodStyle"+number4;
			var prodColorName="prodColor"+number4;
		}
		else
		{
			var prodStyleName="prodStyle";
			var prodColorName="prodColor";
		}
		results = xmlHttp.responseText.split("||");
		document.getElementById(prodStyleName).innerHTML = results[0];
		document.getElementById(prodColorName).innerHTML = results[1];
	}
}

function styleStateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		if(number5 > 0)
		{
			var prodStyleName="prodStyle"+number5;
		}
		else
		{
			var prodStyleName="prodStyle";
		}
		document.getElementById(prodStyleName).innerHTML = xmlHttp.responseText;
	}
}


function GetXmlHttpObject(handler)
{
	var objXmlHttp=null
		
	if (navigator.userAgent.indexOf("Safari")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler
		return objXmlHttp
	}
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler
		return objXmlHttp
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		}
		try
		{
			objXmlHttp=new ActiveXObject(strName)
			objXmlHttp.onreadystatechange=handler
			return objXmlHttp
		}
		catch(e)
		{
			alert("Error. Scripting for ActiveX might be disabled")
			return
		}
	}

	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler
		return objXmlHttp
	}
	
	
}



function reminder(prodid,typex) {
var xmlHttpReq = false;
var self = this;
	
	if (window.XMLHttpRequest) {
	self.xmlHttpReq = new XMLHttpRequest();
	}
   	
	else if (window.ActiveXObject) {
	self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}

ShowContent('notdiv');

document.getElementById("notdiv").innerHTML = "<br><br><center>Please wait, checking inventory...</center>";

	
self.xmlHttpReq.open('POST', 'http://www.halloweenpartystore.com/messenger.php?mode=reminder', true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {


if (self.xmlHttpReq.readyState == 4) {
document.getElementById('notdiv').innerHTML = self.xmlHttpReq.responseText;
}


}

qstr = 'id=' + escape(prodid)+'&m='+escape(typex);
self.xmlHttpReq.send(qstr);
}


function send_reminder() {
var xmlHttpReq = false;
var self = this;
	
	if (window.XMLHttpRequest) {
	self.xmlHttpReq = new XMLHttpRequest();
	}
   	
	else if (window.ActiveXObject) {
	self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}


self.xmlHttpReq.open('POST', 'http://www.halloweenpartystore.com/messenger.php?mode=sendreminder', true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {



if (self.xmlHttpReq.readyState == 4) {
	
	if (self.xmlHttpReq.responseText == "1") {
	alert('You successfully created this reminder! We will let you know as soon as we have available inventory for the option you selected');
	document.getElementById('rbutton').disabled = 'true';
	}
	else {
	alert(self.xmlHttpReq.responseText);
	}
	
}

}

var email = document.getElementById('reminder_email').value;
var option = document.getElementById('reminder_option').value;
var code = document.getElementById('code').value;
qstr = 'email=' + escape(email)+'&option='+escape(option)+'&code='+escape(code);
self.xmlHttpReq.send(qstr);
}
