<!--

function init_quote() {

toggleLayer('offer','off');
DisplayQuote();

}


function toggleLayer( whichLayer, state )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  
  vis.display=(state=='off')?'none':'block';
  
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function setPackaging(value) {
   var myobject=document.forms['quickquote'].elements['inserts'];
   
   var myCheckbox=new Array('i_none','i_sf','i_df','i_tc','i_amaray','i_amarayi');
   
   
   switch(value) {
    case "off":
     var radioLength = myCheckbox.length;
     for(var i = 1; i < radioLength; i++) {
		// myobject[i].disabled=true;		
		document.forms['quickquote'].elements[myCheckbox[i]].disabled=true;
		document.forms['quickquote'].elements[myCheckbox[i]].checked=false;
		}
			
		document.forms['quickquote'].elements['i_none'].checked=true;
	
    break;
   
    case "on":
   	var radioLength = myCheckbox.length;
     for(var i = 1; i < radioLength; i++) {
		 document.forms['quickquote'].elements[myCheckbox[i]].disabled=false;
		}
    break;
    
    case "jc":
     var radioLength = myCheckbox.length;
     for(var i = 1; i < radioLength; i++) {
		document.forms['quickquote'].elements[myCheckbox[i]].disabled=false;
		}
		
		for (var i=4; i<6; i++) {
		document.forms['quickquote'].elements[myCheckbox[i]].disabled=true;
		document.forms['quickquote'].elements[myCheckbox[i]].checked=false;
		}
		
		document.forms['quickquote'].elements['i_none'].checked=true;
			
    break;
    
    case "slim":
     var radioLength = myCheckbox.length;
     for(var i = 1; i < radioLength; i++) {
		 document.forms['quickquote'].elements[myCheckbox[i]].disabled=false;
		}
		
		for (var i=3; i<6; i++) {
			document.forms['quickquote'].elements[myCheckbox[i]].disabled=true;
			document.forms['quickquote'].elements[myCheckbox[i]].checked=false;
		}
		
		document.forms['quickquote'].elements['i_none'].checked=true;
		
      break;
      
    case "amaray":
     var radioLength = myCheckbox.length;
     for (var i = 1; i < radioLength; i++) {
		 document.forms['quickquote'].elements[myCheckbox[i]].disabled=false;
		}
				
		for (var i=1; i<4; i++) {
		document.forms['quickquote'].elements[myCheckbox[i]].disabled=true;
		document.forms['quickquote'].elements[myCheckbox[i]].checked=false;
		}
		
		document.forms['quickquote'].elements['i_none'].checked=true;
      break;
      }
      
      DisplayQuote();
      
}
    
function setPrint(mycheck) {

var myCheckbox=new Array('i_none','i_sf','i_df','i_tc','i_amaray','i_amarayi');
var checkbox_count = myCheckbox.length;

for (var i = 1; i < checkbox_count; i++) {
	if (document.forms['quickquote'].elements[myCheckbox[i]].checked==true) {
	document.forms['quickquote'].elements[myCheckbox[0]].checked=false;
	}
}

switch(mycheck) {

	case "i_none":
		for (var i = 1; i < checkbox_count; i++) {		
			document.forms['quickquote'].elements[myCheckbox[i]].checked=false;
		}
		document.forms['quickquote'].elements[myCheckbox[0]].checked=true;
	break;
	case "i_sf":
		document.forms['quickquote'].elements[myCheckbox[0]].checked=false;
		document.forms['quickquote'].elements[myCheckbox[2]].checked=false;
		document.forms['quickquote'].elements[myCheckbox[4]].checked=false;
		document.forms['quickquote'].elements[myCheckbox[5]].checked=false;
		
	break;
	case "i_df":
		document.forms['quickquote'].elements[myCheckbox[0]].checked=false;
		document.forms['quickquote'].elements[myCheckbox[1]].checked=false;
		document.forms['quickquote'].elements[myCheckbox[4]].checked=false;
		document.forms['quickquote'].elements[myCheckbox[5]].checked=false;
	break;
	case "i_tc":
		document.forms['quickquote'].elements[myCheckbox[0]].checked=false;		
		document.forms['quickquote'].elements[myCheckbox[4]].checked=false;
		document.forms['quickquote'].elements[myCheckbox[5]].checked=false;
	break;
	case "i_amaray":
		for (var i = 0; i < 4; i++) {		
			document.forms['quickquote'].elements[myCheckbox[i]].checked=false;
		}
	break;
	case "i_amarayi":
		for (var i = 0; i < 4; i++) {		
    		document.forms['quickquote'].elements[myCheckbox[i]].checked=false;
		}
	break;
	}
	
	var is_checked=false;
	
	for (var i = 1; i < checkbox_count; i++) {
		if (document.forms['quickquote'].elements[myCheckbox[i]].checked==true) {
		 is_checked=true;
		}
	}
	
	
	if (is_checked==false){
	document.forms['quickquote'].elements[myCheckbox[0]].checked=true;
	}
	
	DisplayQuote();

}

function DisplayQuote() {
   var quote = 123456;
   var type = getCheckedValue(document.forms['quickquote'].elements['disctype']);
   var color = getCheckedValue(document.forms['quickquote'].elements['printtype']);
   var style = getCheckedValue(document.forms['quickquote'].elements['surface']);
   var pack = getCheckedValue(document.forms['quickquote'].elements['packaging']);
   var data = getCheckedValue(document.forms['quickquote'].elements['data']);
   var quantity = document.forms['quickquote'].elements['quantity'].value;
   var colors = document.forms['quickquote'].elements['ss_colors'].value;
   var packcost=0;
   var disccost=0;
   var turntime=0;
   var totalcost=0;
   
   		
   //setup silkscreen pricing arrays
   var cd_ss_array = new Array(7);
   cd_ss_array[0] = new Array(0.94,1.05,1.16,1.28,1.39,1.05,1.16);
   cd_ss_array[1] = new Array(0.59,0.66,0.73,0.80,0.87,0.66,0.73);
   cd_ss_array[2] = new Array(0.43,0.46,0.50,0.53,0.57,0.46,0.50);
   cd_ss_array[3] = new Array(0.39,0.42,0.44,0.47,0.52,0.42,0.44);
   cd_ss_array[4] = new Array(0.37,0.40,0.42,0.45,0.47,0.40,0.42);
   cd_ss_array[5] = new Array(0.33,0.34,0.37,0.39,0.40,0.34,0.37);
   cd_ss_array[6] = new Array(0.31,0.32,0.33,0.34,0.35,0.32,0.33);
   
   var dvd_ss_array = new Array(7);
   dvd_ss_array[0] = new Array(1.06,1.17,1.28,1.40,1.51,1.17,1.28);
   dvd_ss_array[1] = new Array(0.71,0.78,0.85,0.92,0.99,0.78,0.85);
   dvd_ss_array[2] = new Array(0.55,0.58,0.62,0.65,0.69,0.58,0.62);
   dvd_ss_array[3] = new Array(0.51,0.54,0.56,0.59,0.64,0.54,0.56);
   dvd_ss_array[4] = new Array(0.49,0.52,0.54,0.57,0.59,0.52,0.54);
   dvd_ss_array[5] = new Array(0.45,0.46,0.49,0.51,0.52,0.46,0.49);
   dvd_ss_array[6] = new Array(0.43,0.44,0.45,0.46,0.47,0.44,0.45);

   
   if (quantity<=500) turntime=1;
   if (quantity>500 && quantity<=1000) turntime=2;
   if (quantity>1000 && quantity<=1500) turntime=3;
   if (quantity>1500 && quantity<=2000) turntime=4;
   
   switch(pack) {
   
   case "none":
   	packcost=0;
   break;
   case "Windowed Paper Sleeve":
   	packcost=(quantity<500 ? .12 * quantity : .10 * quantity);
   break;
   case "Clear Polysleeve":
   	packcost=(quantity<500 ? .12 * quantity : .10 * quantity);
   break;
   case "Clear cShell":
   	packcost=(quantity<500 ? .30 * quantity : .28 * quantity);
   break;
   case "Clear/Black Slimline Jewelcase":
   	packcost=(quantity<500 ? .30 * quantity : .28 * quantity);
   break;
   case "Clear/Black Jewelcase":
   	packcost=(quantity<500 ? .35 * quantity : .30 * quantity);
   break;
   case "Black Amaray Case":
   	packcost=(quantity<500 ? .30 * quantity : .28 * quantity);
   break;
   
   }
   
   switch(data) {
   
   case "Blank":
    datacost=0;
   break;
   case "Data":
    if (type=="CD") {
   	datacost=(quantity<500 ? .08 * quantity : .08 * quantity);
   	} else {
   	datacost=(quantity<500 ? .08 * quantity : .08 * quantity);
   	}
   break;
   }
   
   if (color=="Black and Silver") {
   color="Black and White";
   }
   
   if (color=="Color Silver") {
   color="Color White";
   }
   
   switch (type) {
   	case "CD":
   		switch (color) {
   			case ("Black and White"):
   				if (quantity<50) disccost=35+0.89*quantity;
   				if (quantity>=50 && quantity<200) disccost=0.89*quantity;
   				if (quantity>=200 && quantity<300) disccost=.81*quantity;
   				if (quantity>=300 && quantity<400) disccost=.73*quantity;
   				if (quantity>=400 && quantity<500) disccost=.65*quantity;
   				if (quantity>=500 && quantity<1000) disccost=.62*quantity;
   				if (quantity>=1000 && quantity<2000) disccost=.54*quantity;
   				if (quantity>=2000) disccost=0.53*quantity;
   				toggleLayer('sscolors', 'off');
   				break;
   			case "Color White":
   				if (quantity<50) disccost=35+1.49*quantity;
   				if (quantity>=50 && quantity<200) disccost=1.15*quantity;
   				if (quantity>=200 && quantity<300) disccost=1.10*quantity;
   				if (quantity>=300 && quantity<400) disccost=1.05*quantity;
   				if (quantity>=400 && quantity<500) disccost=0.95*quantity;
   				if (quantity>=500 && quantity<1000) disccost=0.90*quantity;
   				if (quantity>=1000 && quantity<2000) disccost=0.75*quantity;
   				if (quantity>=2000) disccost=0.70*quantity;
   				toggleLayer('sscolors','off');
   				break;
   			case "Silkscreen":  				
   				if (quantity>=300 && quantity<=499) disccost=cd_ss_array[0][colors]*quantity;
   				if (quantity>499 && quantity<=999) disccost=cd_ss_array[1][colors]*quantity;
   				if (quantity>999 && quantity<=1999) disccost=cd_ss_array[2][colors]*quantity;
   				if (quantity>1999 && quantity<=2999) disccost=cd_ss_array[3][colors]*quantity;
   				if (quantity>2999 && quantity<=4999) disccost=cd_ss_array[4][colors]*quantity;
   				if (quantity>4999 && quantity<=9999) disccost=cd_ss_array[5][colors]*quantity;
   				if (quantity>9999) disccost=cd_ss_array[6][colors]*quantity;;
   				toggleLayer('sscolors','on');
   				break;
   			}
   		break;
   	case "DVD":
   		switch (color) {
   			case "Black and White":
   				if (quantity<50) disccost=35+1.09*quantity;
   				if (quantity>=50 && quantity<200) disccost=1.09*quantity;
   				if (quantity>=200 && quantity<300) disccost=1.01*quantity;
   				if (quantity>=300 && quantity<400) disccost=0.93*quantity;
   				if (quantity>=400 && quantity<500) disccost=0.85*quantity
   				if (quantity>=500 && quantity<1000) disccost=0.82*quantity
   				if (quantity>=1000 && quantity<2000) disccost=0.74*quantity
   				if (quantity>=2000) disccost=0.70*quantity
   				break;
   			case "Color White":
   				if (quantity<50) disccost=35+1.50*quantity;
   				if (quantity>=50 && quantity<200) disccost=1.50*quantity;
   				if (quantity>=200 && quantity<300) disccost=1.37*quantity;
   				if (quantity>=300 && quantity<400) disccost=1.25*quantity;
   				if (quantity>=400 && quantity<500) disccost=1.15*quantity
   				if (quantity>=500 && quantity<1000) disccost=1.05*quantity
   				if (quantity>=1000 && quantity<2000) disccost=0.90*quantity
   				if (quantity>=2000) disccost=0.82*quantity
   				break;
   			case "Silkscreen":
   				if (quantity>=300 && quantity<=499) disccost=dvd_ss_array[0][colors]*quantity;
   				if (quantity>499 && quantity<=999) disccost=dvd_ss_array[1][colors]*quantity;
   				if (quantity>999 && quantity<=1999) disccost=dvd_ss_array[2][colors]*quantity;
   				if (quantity>1999 && quantity<=2999) disccost=dvd_ss_array[3][colors]*quantity;
   				if (quantity>2999 && quantity<=4999) disccost=dvd_ss_array[4][colors]*quantity;
   				if (quantity>4999 && quantity<=9999) disccost=dvd_ss_array[5][colors]*quantity;
   				if (quantity>9999) disccost=dvd_ss_array[6][colors]*quantity;;
   				toggleLayer('sscolors','on');
   				break;
   			}
   		break;
   	
   	}
   	
   printcost=0;
   if (document.forms['quickquote'].elements['i_none'].checked==true) {
   printcost=0;
   }
   
   'i_sf','i_df','i_tc','i_amaray','i_amarayi'
   
   if (document.forms['quickquote'].elements['i_sf'].checked==true) {
   printcost=0.3*quantity;
   }
   
   if (document.forms['quickquote'].elements['i_df'].checked==true) {
   printcost=0.55*quantity;
   }
   
   if (document.forms['quickquote'].elements['i_tc'].checked==true) {
   printcost=printcost + (0.35*quantity);
   }
   
    if (document.forms['quickquote'].elements['i_amaray'].checked==true) {
   printcost=0.50*quantity;
   }
   
   if (document.forms['quickquote'].elements['i_amarayi'].checked==true) {
   printcost=printcost + (0.32*quantity);
   }
   	
   totalcost=packcost+disccost+datacost+printcost;
   totalcost=Math.round(totalcost*100)/100;
   unitcost=totalcost/quantity;
   unitcost=Math.round(unitcost*100)/100;
   totalcost="Cost = $" + totalcost + " ($" + unitcost + "/unit) + shipping & tax";
   	
   var head1 = document.getElementById("head1");
   var head2 = document.getElementById("head2");
   
   if (quantity<300 && color=="Silkscreen") {
   totalcost = "Silkscreen printing requires 300 discs or more.";
   }
   
   head1.firstChild.nodeValue=totalcost;
   
   if (quantity<2000) {
   	if (turntime==1) {
   		head2.firstChild.nodeValue = turntime + " business day";
   		} else {
   		head2.firstChild.nodeValue = turntime + " business days";
   		}
   } else {
   head2.firstChild.nodeValue = "Call for time";
   }
   
   document.forms['quickquote'].elements['cost'].value=totalcost;
   document.forms['quickquote'].elements['turntime'].value="";
}


function checkForInt(evt) {
	//notice that the check is != null now, as the tab key has a value of 0
	var charCode = ( evt.which != null ) ? evt.which : event.keyCode
	//charCodes < 32 include tab, delete, arrow keys, etc
	return (charCode < 32 || (charCode >= 48 && charCode <= 57))
	DisplayQuote();
}


-->