// JavaScript Document
function killcookie()

{document.cookie = 'name=; expires=Fri, 13-Apr-1970 00:00:00 GMT';

} //end killcookie function


function writecookie()

{

killcookie();

var peccookie="^";

peccookie+=document.PECquote_form.FinanceAmt.value+"^";

peccookie+=document.PECquote_form.EquipmentType.value+"^";

peccookie+=document.PECquote_form.EquipmentName.value+"^";

peccookie+=document.PECquote_form.Company.value+"^";

peccookie+=document.PECquote_form.Address1.value+"^";

peccookie+=document.PECquote_form.CustomerCity.value+"^";

peccookie+=document.PECquote_form.CustomerState.value+"^";

peccookie+=document.PECquote_form.CustomerZip.value+"^";

peccookie+=document.PECquote_form.Phone_No.value+"^";

peccookie+=document.PECquote_form.Fax.value+"^";

peccookie+=document.PECquote_form.realname.value+"^";

peccookie+=document.PECquote_form.email.value+"^";

peccookie+=document.PECquote_form.EquipmentVendor.value+"^";

peccookie+=document.PECquote_form.VendorContact.value+"^";

peccookie+=document.PECquote_form.VendorAddress1.value+"^";

peccookie+=document.PECquote_form.VendorCity.value+"^";

peccookie+=document.PECquote_form.VendorState.value+"^";

peccookie+=document.PECquote_form.VendorZip.value+"^";

peccookie+=document.PECquote_form.VendorPhone.value+"^";

peccookie+=document.PECquote_form.VendorFax.value+"^";

peccookie+=document.PECquote_form.savecust.checked+"^";

peccookie+=document.PECquote_form.savevendor.checked+"^";

peccookie+=document.PECquote_form.KonicaRep.value+"^";

peccookie+=document.PECquote_form.KonicaRepContact.value+"^";

var exp_date = new Date("December 31, 2025");

var the_cookie_date = exp_date.toGMTString();

document.cookie ="PECCookie="+escape(peccookie)+";expires="+the_cookie_date;

} //end writecookie function



function ReadCookie()

{

document.PECquote_form.FinanceAmt.value='';

document.PECquote_form.EquipmentType.value='';

document.PECquote_form.EquipmentName.value='';

document.PECquote_form.Company.value='';

document.PECquote_form.Address1.value='';

document.PECquote_form.CustomerCity.value='';

document.PECquote_form.CustomerState.value='';

document.PECquote_form.CustomerZip.value='';

document.PECquote_form.Phone_No.value='';

document.PECquote_form.Fax.value='';

document.PECquote_form.realname.value='';

document.PECquote_form.email.value='';

document.PECquote_form.EquipmentVendor.value='';

document.PECquote_form.VendorContact.value='';

document.PECquote_form.VendorAddress1.value='';

document.PECquote_form.VendorCity.value='';

document.PECquote_form.VendorState.value='';

document.PECquote_form.VendorZip.value='';

document.PECquote_form.VendorPhone.value='';

document.PECquote_form.VendorFax.value='';

document.PECquote_form.KonicaRep.value='';

document.PECquote_form.KonicaRepContact.value='';

if(document.cookie == '') {return false;}

var mycookie=document.cookie;

mycookie=unescape(mycookie);

var cookie_array = mycookie.split("^");

var loadcustinfo=cookie_array[21];

var loadvendorinfo=cookie_array[22];

if (loadcustinfo=='true')

{

document.PECquote_form.FinanceAmt.value=cookie_array[1];

document.PECquote_form.EquipmentType.value=cookie_array[2];

document.PECquote_form.EquipmentName.value=cookie_array[3];

document.PECquote_form.Company.value=cookie_array[4];

document.PECquote_form.Address1.value=cookie_array[5];

document.PECquote_form.CustomerCity.value=cookie_array[6];

document.PECquote_form.CustomerState.value=cookie_array[7];

document.PECquote_form.CustomerZip.value=cookie_array[8];

document.PECquote_form.Phone_No.value=cookie_array[9];

document.PECquote_form.Fax.value=cookie_array[10];

document.PECquote_form.realname.value=cookie_array[11];

document.PECquote_form.email.value=cookie_array[12];

}

if (loadvendorinfo=='true')

{

document.PECquote_form.EquipmentVendor.value=cookie_array[13];

document.PECquote_form.VendorContact.value=cookie_array[14];

document.PECquote_form.VendorAddress1.value=cookie_array[15];

document.PECquote_form.VendorCity.value=cookie_array[16];

document.PECquote_form.VendorState.value=cookie_array[17];

document.PECquote_form.VendorZip.value=cookie_array[18];

document.PECquote_form.VendorPhone.value=cookie_array[19];

document.PECquote_form.VendorFax.value=cookie_array[20];

document.PECquote_form.KonicaRep.value=cookie_array[23];

document.PECquote_form.KonicaRepContact.value=cookie_array[24];

}

document.PECquote_form.EquipmentType.value=cookie_array[2];

} //end read cookie function


function authenticationPass() 

{
	if ( document.rateselect.table.value == '8') {

		if ( document.rateselect.authpass.value == 'KMGI' ) {
			var url = "forms/rates.php?table=" + document.rateselect.table.value;
			window.open(url,'ratewindow','width=680,height=800,scrollbars=yes');
		} else {
			alert("Incorrect password. try again.");
			window.location="vendors.php";
		} 
	} else {

		if ( document.rateselect.authpass.value == 'Elvis' ) {
			var url = "forms/rates.php?table=" + document.rateselect.table.value;
			window.open(url,'ratewindow','width=680,height=800,scrollbars=yes');
		} else {
			alert("Incorrect password. try again.");
			window.location="vendors.php";
		}
	}

	
}



