function goToBuyQube(screen){
	
	document.mailmyform_form.action = screen;
	document.mailmyform_form.method = "post";
	document.mailmyform_form.submit();
}



function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function CreateCookies(){
	
	alert("P200 transaction fee will be added to the total price.");
	var _customername = document.mailmyform_form.Customer;
	var _shippingaddress = document.mailmyform_form.Address;
	var _email = document.mailmyform_form.Email;
	var _contactnumber = document.mailmyform_form.CNumber;
	var _instructions = document.mailmyform_form.Comment;

	createCookie("KabanCustomerName",_customername.value,1);
	createCookie("KabanShippingAddress",_shippingaddress.value,1);
	createCookie("KabanEmail",_email.value,1);
	createCookie("KabanContactNumber",_contactnumber.value,1);
	createCookie("KabanInstructions",_instructions.value,1);
	
	var name = mailmyform_form.Customer.value;
	var address =  mailmyform_form.Address.value;
	var email = mailmyform_form.Email.value;
	var number = mailmyform_form.CNumber.value;
	var processor = mailmyform_form.Processor.value;
	var motherboard = mailmyform_form.Motherboard.value;
	var os = mailmyform_form.OS.value;
	var prod = mailmyform_form.Productivity.value;
	var video = mailmyform_form.Video.value;
	var mem = mailmyform_form.Memory.value;
	var hd = mailmyform_form.HardDrive.value;
	var od = mailmyform_form.OpticalDrive.value;
	var fd = mailmyform_form.FloppyDrive.value;
	var monitor = mailmyform_form.Monitor.value;
	var power = mailmyform_form.Power.value;
	var mouse = mailmyform_form.Mouse.value;
	var mp = mailmyform_form.MousePad.value;
	var kb = mailmyform_form.Keyboard.value;
	var speakers = mailmyform_form.Speakers.value;
	var accessories = mailmyform_form.Accessories.value;
	var accessories2 = mailmyform_form.Accessories2.value;
	var casing = mailmyform_form.Casing.value;
	var powersupply = mailmyform_form.PowerSupply.value;
	var quan = mailmyform_form.Quantity.value;
	var pay = mailmyform_form.Payment.value;
	var total = mailmyform_form.totalPrice.value;
	var card = mailmyform_form.cardTotalPrice.value;
	
	var details = "<br>Processor: " + processor + "<br>Motherboard:" + motherboard + "<br>Operating System: " + os + "<br>Productivity Suite: " + prod + "<br>Video Card: " + video +"<br>Memory: " + mem + "<br>Hard Drive: " + hd + "<br>Optical Drive: " + od + "<br>Media Drive: " + fd + "<br>Monitor: " + monitor + "<br>Power: " + power + "<br>Mouse: " + mouse + "<br>Mouse Pad: " + mp + "<br>Keyboard: " + kb + "<br>Speakers: " + speakers + "<br>Accessories: " + accessories + "<br>Accessories: " + accessories2 + "<br>Casing: " + casing + "<br>Power Supply: " + powersupply + "<br>Quantity: " + quan ;


	createCookie("KabanDetails",details,1);
	
	var tempamount = card.replace("P ", "");

	createCookie("KabanTotal",tempamount,1);

	
	document.mailmyform_form.action = "Kaban.php";
	document.mailmyform_form.submit();
}


function CreatCookieShort(){
	
		alert("P200 transaction fee will be added to the total price.");
		var _customername = document.mailmyform_form.Customer;
		var _shippingaddress = document.mailmyform_form.Address;
		var _email = document.mailmyform_form.Email;
		var _contactnumber = document.mailmyform_form.CNumber;
		var _instructions = document.mailmyform_form.Comment;
		var _monitor = document.mailmyform_form.Item;
		var _quan = document.mailmyform_form.Quantity;
		var _total = document.mailmyform_form.totalPrice;

		
		createCookie("KabanCustomerName",_customername.value,1);
		createCookie("KabanShippingAddress",_shippingaddress.value,1);
		createCookie("KabanEmail",_email.value,1);
		createCookie("KabanContactNumber",_contactnumber.value,1);
		createCookie("KabanInstructions",_instructions.value,1);
		
//		var details = "fjskdfj gjdsjkdsjg jgfdjgkfdjg kdj gkj kjgfgjfdghfdjgh jdfghdhdjfghlfdghfdljghfdljgh hgfd";
		var details = "<br>Customer Name: " + _customername.value + "<br>Shipping Address: " + _shippingaddress.value + "<br>Email Address: " + _email.value + "<br>Contact Number: " + _contactnumber.value + "<br>Instructions: " + _instructions.value + "<br>Item: " + _monitor.value + "<br>Quantity: " + _quan.value + "<br><br>Total: " + _total.value + "<br>" ;

		createCookie("KabanDetails",details,1);
		var tempamount = _total.value.replace("P ", "");
		
		createCookie("KabanTotal",tempamount,1);

		//alert('tapos na');
		document.mailmyform_form.action = "Kaban.php";
		document.mailmyform_form.submit();

		//window.location.href('toKaban.asp');
}
function go() {
	location.href("www.yehey.com");
}
function eraseCookie(name) {
	createCookie(name,"",-1);
}
function createCookie(name,value,days) {

	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";

	document.cookie = name+"="+value+expires+"; path=/";
}

function EnableKaban(){

	var ind = mailmyform_form.Payment.selectedIndex;
	//alert(mailmyform_form.Payment.selectedIndex);
	//alert(mailmyform_form.Payment.options[ind].value);
	if (mailmyform_form.Payment.options[ind].value == "Cash")
	{
		document.mailmyform_form.Submit2.disabled=true;
		document.mailmyform_form.Submit.disabled=false;
	}
	else if (mailmyform_form.Payment.options[ind].value == "Pay Thru Kaban")
	{
		document.mailmyform_form.Submit2.disabled=false;
		document.mailmyform_form.Submit.disabled=true;
	}
	else {
		document.mailmyform_form.Submit2.disabled=true;
		document.mailmyform_form.Submit.disabled=false;
	}
	/*if (mailmyform_form.Payment.options[ind].value == "Cash")
	{
	alert ('enter');
	//mailmyform_form.Payment.selectedIndex
	mailmyform_form.Submit2.style = visibility:visible;
	mailmyform_form.Submit1.style = visibility:hidden;
	}
	else{
	alert ('enter');
	mailmyform_form.Submit2.style = visibility:hidden;
	mailmyform_form.Submit1.style = visibility:visible;
	}*/
	
	/*	<option value="Cash" selected>Cash</option>
					<option value="Pay Thru Kaban">Pay Thru Kaban</option> */
					
	

}

