function PurchaseSurvey(code) {
	var form = document.buynowform;
	form.productcode.value = code;
	form.submit();
}
function UMCSpecs() {
	var generator = window.open('','LEDDetails','height=550,width=500,resizable=false,location=false');
	var popup = "<html>\n";
	popup += "\t<head>\n";
	popup += "\t\t<title>Universal Mobile Charger Specifications</title>\n";
	popup += "\t</head>\n";
	popup += "\t<body>\n";
	popup += "\t\t<center>\n";
	popup += "\t\t\t<span style='font-size:14pt; font-weight:bolder;'>\n";
	popup += "\t\t\t\tUniversal Mobile Charger Specifications\n";
	popup += "\t\t\t</span>\n";
	popup += "\t\t</center>\n";
	popup += "\t\t<br /><br />\n";
	popup += "\t\t<strong>Product Details:</strong><br />\n";
	popup += "\t\t<ul style='margin-top:0px;'>\n";
	popup += "\t\t\t<li>Battery Type: Li-ion</li>\n";
	popup += "\t\t\t<li>Voltage: 5.5V</li>\n";
	popup += "\t\t\t<li>Capacity: 4400 mAh</li>\n";
	popup += "\t\t\t<li>Weight: 3.8 oz (110g)</li>\n";
	popup += "\t\t\t<li>Color: Black</li>\n";
	popup += "\t\t\t<li>Dimension: L3” x W1.9” x H1” (78 x 48 x 26 mm)</li>\n";
	popup += "\t\t\t<li>Input port: Mini USB</li>\n";
	popup += "\t\t\t<li>Output port: DC</li>\n";
	popup += "\t\t</ul>\n";
	popup += "\t\t<br />\n";
	popup += "\t\t<strong>LED Light Indicators:</strong><br />\n";
	popup += "\t\t<ol type='a' style='margin-top:0px;'>\n";
	popup += "\t\t\t<li>Charging indicator: No light.AC adapter LED lights green. (I have to check what happens when UMC is fully charged)</li>\n";
	popup += "\t\t\t<li>Discharging indicator: green</li>\n";
	popup += "\t\t\t<li>Red light when your DocuPen is fully charged</li>\n";
	popup += "\t\t\t<li>Power indicator: Discharging LED will light in green when the UMC connects with the Output line. This indicates that the UMC has power; If the LED does not light up,  then the UMC has no power and you need to charge it from the AC outlet.</li>\n";
	popup += "\t\t</ol>\n";
	popup += "\t</body>\n";
	popup += "</html>\n";
	
	generator.document.write(popup);
	generator.document.close();
}
function setSail() {
	var url = "http://www.planon.com/accessories.php#";
	var val = document.choose.productlist.value;
	location = url+val;
}
function lightUp() {
	var generator = window.open('','LEDDetails','height=250,width=500,resizable=false,location=false');
	var popup = "<html>\n";
	popup += "\t<head>\n";
	popup += "\t\t<title>Universal Mobile Charger LED Details</title>\n";
	popup += "\t</head>\n";
	popup += "\t<body>\n";
	popup += "\t\t<strong>LED Light Indicators:</strong><br />\n";
	popup += "\t\t<ol type='a'>\n";
	popup += "\t\t\t<li>Charging indicator: No light.AC adapter LED lights green. (I have to check what happens when UMC is fully charged)</li>\n";
	popup += "\t\t\t<li>Discharging indicator: green</li>\n";
	popup += "\t\t\t<li>Red light when your DocuPen is fully charged</li>\n";
	popup += "\t\t\t<li>Power indicator: Discharging LED will light in green when the UMC connects with the Output line. This indicates that the UMC has power; If the LED does not light up,  then the UMC has no power and you need to charge it from the AC outlet.</li>\n";
	popup += "\t\t</ol>\n";
	popup += "\t</body>\n";
	popup += "</html>\n";
	
	generator.document.write(popup);
	generator.document.close();
}
function doPostBack() {
	var theform;

	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		theform = document.warform;
	} else {
		theform = document.forms["warform"];
	}
	theform.switchdate.value = "true";
	theform.submit();
}
function checkForm() {
	var i = 0;
	var alright = 0;
	var total = 0;
	var txtag = 0;
	var form = document.warform;
	var elements = form.elements.length;

	for (i; i < elements; i++) {
		var element = form.elements[i];

		if (element.type == "text" && element.name != "Apartment") {
			txtag++;
			var errTag = document.getElementById("tx" + txtag);

			total += 1;
			if (element.value != "") {
				alright += 1;
				errTag.innerHTML = "";
			} else {
				errTag.innerHTML = "&nbsp;&nbsp;*";
			}
		}
	}

	var bannerTag = document.getElementById("error");
	if (alright == total) {
		bannerTag.innerHTML = "";
		form.submit();
	} else {
		bannerTag.innerHTML = "Please complete the form<br/>The missing fields are marked off with an asterix '*'";
	}
}
