
function printpage() {
	window.print();  
}
function popUp(page,name,width,height,scrollbar,toolbar,resizable) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(page, '" + id + "', 'toolbar="+toolbar+",scrollbars="+scrollbar+",location=0,statusbar=0,menubar=0,resizable="+resizable+",width="+width+",height="+height+"');");
}
function popup(page) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('http://www.pcsorders.com/source/desc/'+page, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=450');");
}
function phone_desc(num) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('http://www.pcsorders.com/source/phone_desc.php?id='+num, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=600');");
}
function sprint(page) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(page, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=450');");
}
function coverage() {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('http://www1.sprintpcs.com/explore/coverage/CoverageOverviewNVP.jsp', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=575,height=550');");
}
function current(site) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('https://pcsorders.com/source/current.php?site='+site, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=450');");
}
function upgrade(site,phoneID) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('https://pcsorders.com/"+site+"/upgrade.php?site='+site+'&phoneID='+phoneID, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=575,height=645');");
}
function upgradeDefault(site,phoneID) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('https://pcsorders.com/source/phoneUpgrade.php?site='+site+'&phoneID='+phoneID, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=575,height=645');");
}
function upgradeCustom(site,phoneID) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('https://pcsorders.com/'+site+'/phoneUpgrade.php?site='+site+'&phoneID='+phoneID, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=575,height=645');");
}
function replacement(site) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('https://pcsorders.com/source/replacement.php?site='+site, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=450');");
}

function updateShipping(){
	value = document.getElementById("shipping").value;
	window.location="index.php?p=order&action=updateShipping&code="+value;
}

//age check
function checkAge(theForm)
{
	/* the minumum age you want to allow in */
	var min_age18 = 18;
	var min_age19 = 19;
	var min_age21 = 21;
	
	/* change "age_form" to whatever your form has for a name="..." */
	var year = parseInt(theForm.dob3.value);
	var month = parseInt(theForm.dob1.value) - 1;
	var day = parseInt(theForm.dob2.value);
	
	var theirDate18 = new Date((year + min_age18), month, day); //18 
	var theirDate19 = new Date((year + min_age19), month, day); //19
	var theirDate21 = new Date((year + min_age21), month, day); //21
	var today = new Date;
	
	if ( (today.getTime() - theirDate21.getTime()) < 0 && (theForm.state.value=="PR" || theForm.state.value=="pr" || theForm.state.value=="MS" || theForm.state.value=="ms")) {
		alert("If you are below 21 years of age, your order cannot be processed.");
		return false;
	} else if ( (today.getTime() - theirDate19.getTime()) < 0 && (theForm.state.value=="AL" || theForm.state.value=="al" || theForm.state.value=="NE" || theForm.state.value=="ne")) {
		alert("If you are below 19 years of age, your order cannot be processed.");
		return false;
	} else if ( (today.getTime() - theirDate18.getTime()) < 0) {
		alert("If you are below 18 years of age, your order cannot be processed.");
		return false;
	} else {
		return true;
	}
}

//select phone
function checkPhone(theForm){
	phoneError = false;
	if(theForm.service.value){
		if(theForm.service.checked == false) phoneError = true;
		else phoneError = false;
	} else {
		phoneError = true;
		for(i=0;i<theForm.service.length;i++){
			if(theForm.service[i].checked == true) phoneError = false;
		}
	}
	
	if(phoneError) {
		alert("Select a service agreement");
		return false;
	} else return true;
}

/* SHOW/HIDE PHONE SPECS */
function phoneHighlights() {
	if(document.getElementById("highlights").className == "phoneInfoHide") document.getElementById("highlights").className = "phoneInfoMore";
		else document.getElementById("highlights").className = "phoneInfoHide";
}
function phoneKey() {
	if(document.getElementById("key").className == "phoneInfoHide") document.getElementById("key").className = "phoneInfoMore";
		else document.getElementById("key").className = "phoneInfoHide";
}
function phoneFeatures() {
	if(document.getElementById("features").className == "phoneInfoHide") document.getElementById("features").className = "phoneInfoMore";
		else document.getElementById("features").className = "phoneInfoHide";
}
function phoneIncluded() {
	if(document.getElementById("included").className == "phoneInfoHide") document.getElementById("included").className = "phoneInfoMore";
		else document.getElementById("included").className = "phoneInfoHide";
}
function phoneSpecs() {
	if(document.getElementById("specs").className == "phoneInfoHide") document.getElementById("specs").className = "phoneInfoMore";
		else document.getElementById("specs").className = "phoneInfoHide";
}
function phonesShowAll() {
	document.getElementById("highlights").className = "phoneInfoMore";
	document.getElementById("key").className = "phoneInfoMore";
	document.getElementById("features").className = "phoneInfoMore";
	document.getElementById("included").className = "phoneInfoMore";
	document.getElementById("specs").className = "phoneInfoMore";
}
function phonesHideAll() {
	document.getElementById("highlights").className = "phoneInfoHide";
	document.getElementById("key").className = "phoneInfoHide";
	document.getElementById("features").className = "phoneInfoHide";
	document.getElementById("included").className = "phoneInfoHide";
	document.getElementById("specs").className = "phoneInfoHide";
}
/* SHOW/HIDE PHONE SPECS */

//allow only 1 submit click
submitcount = 0;
function checkSubmit(){
	if(submitcount == 0){
      submitcount++;
    } else {
      alert("Please click Submit once.");
      return false;
    }
}

function checkPlan(theForm) {
	//CHECK IF A PLAN IS SELECTED
	selectplan = false;
	if(theForm.selectedPlan.length > 1){
		for(i=0;i<theForm.selectedPlan.length;i++){
			if(theForm.selectedPlan[i].checked){
				selectplan = true;
			}
		}
	} else if(theForm.selectedPlan.checked) {
		selectplan = true;
	}
	if(!selectplan){
		alert("Please select a plan");
		return false;
	}
    return true;
}

function checkWorldWide() {
	//CHECK IF WORLDWIDE BLACKBERRY IS SELECTED
	if(document.addOptions.optionBB[0].value == "1072" && document.addOptions.optionBB[0].checked == true){
		document.addOptions.option_1067.disabled = false;
	} else document.addOptions.option_1067.disabled = true;
}

function checkPAM() {
	//CHECK IF PRO PACK IS SELECTED WITH PDA	
	if(document.addOptions.optionData[2].value == "1079" && document.addOptions.optionData[2].checked == true){
		document.addOptions.option_1090.disabled = false;
	} else {
		document.addOptions.option_1090.disabled = true;
		document.addOptions.option_1090.checked = false;
	}
}

<!--
// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function letternumber(e)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// alphas and numbers
else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
   return true;
else
   return false;
}

function letter(e)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// alphas and numbers
else if ((("abcdefghijklmnopqrstuvwxyz").indexOf(keychar) > -1))
   return true;
else
   return false;
}

function number(e)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// alphas and numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;
else
   return false;
}

function phonenumber(e)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// alphas and numbers
else if ((("0123456789-").indexOf(keychar) > -1))
   return true;
else
   return false;
}
//-->

