// JavaScript Document
  function test12(form,selectV,elementId){
	var selectBox= eval("form."+selectV);
	//alert("selectBox" + selectBox);
	var value2 =  selectBox.options[selectBox.selectedIndex].value ;
	//alert("value2"+value2);
	if(value2=='Other'){
		document.getElementById(elementId).style.display = 'inline';
		//alert(document.getElementById(elementId).style.display);
    }else{
	    document.getElementById(elementId).style.display = 'none';
	}
  }

  function GetDisplayFunction_6(){
   var frm = document.frm_Catalog_Booklet.Number_of_Pages.value;
   //alert(frm);
     if(frm=="64 Pages = Cover + 60 Inside Pages"){
		removeOption_2(4);
     }else{
	 // alert("Addtion");
	  AddOption_2();
	 }
  }



function removeOption_2(x){
  var node = document.getElementById('Bindery_455');
  node.removeChild(node.options[x]);
}
function AddOption_2(){
  var node = document.getElementById('Bindery_455');
  node.options[4] = new Option("Saddle-Stitched (Stapled)","Saddle-Stitched (Stapled)");
}
  
function GetDisplayFunction_3(theform){
   var frm = document.frm_Business_Cards.Paper.value;
     if((frm=="80 lb. Gloss Cover") || (frm=="111 lb. Gloss Cover") || (frm=="10pt. C1S Cover") || (frm=="100 lb. Gloss Cover") || (frm=="12pt. C1S Cover")){
       document.getElementById("elementId1").style.display = 'inline';
       document.getElementById("elementId2").style.display = 'inline';
     }else{
	   document.getElementById("elementId1").style.display = 'none';
	   document.getElementById("elementId2").style.display = 'none';
	 }
  }
function GetDisplayFunction_4(){
   var frm = document.frm_Business_Cards.Size.value;
     if((frm=="3.5 x 4")){
       //document.getElementById("Paper_Fold_doc").disabled = false;
     }else{
       //document.getElementById("Paper_Fold_doc").disabled = true;
	 }
  }
function GetDisplayFunction_5(){
   var frm = document.frm_Calendar.Size.value;
     if((frm=="17 x 22")){
		removeOption(3);
     }else{
	  AddOption();
	 }
  }

function removeOption(x){
  var node = document.getElementById('Binding_Type_2');
  node.removeChild(node.options[x]);
  node.removeChild(node.options[x]);
}
function AddOption(){
  var node = document.getElementById('Binding_Type_2');
  node.options[3] = new Option("Glue Bind","Glue Bind");
  node.options[4] = new Option("Other","Other");
}

function valDelForm(theForm)
{
var countCheck;
    countCheck=0;
	for(var i=0;i<document.frm_concept_design.elements.length;i++){
	      var e=document.frm_concept_design.elements[i];
		  if(e.checked == true){
		     countCheck=countCheck+1;
	     }
	 }
	if (countCheck < 2){
       alert("Please check more then one box");
	   return(false);
    }else{
      return(true);
	}
    return(true);
 }


  function show_row(){
    // Make sure the element exists before calling it's properties
	var val = document.test.Product.selectedIndex;    // Which menu item is selected
	//var val = Product[n].value;
	var pro_val;
	if (val == "0" ) { pro_val = "Binders"; }
	if (val == "1" ) { pro_val = "Brochure"; }
	if (val == "2" ) { pro_val = "Business Cards"; }
	if (val == "3" ) { pro_val = "Calendar"; }
	if (val == "4" ) { pro_val = "Carbonless"; }
	if (val == "5" ) { pro_val = "Catalog Booklet"; }
	if (val == "6" ) { pro_val = "Concept Design"; }
	if (val == "7" ) { pro_val = "Door Hanger"; }
	if (val == "8" ) { pro_val = "Envelope Announcement"; }
	if (val == "9" ) { pro_val = "Envelope Catalog"; }
	if (val == "10" ) { pro_val = "Envelope Booklet"; }
	if (val == "11" ) { pro_val = "Envelope Stationary"; }
	if (val == "12" ) { pro_val = "Flyer"; }
	if (val == "13" ) { pro_val = "Greeting Card"; }
	if (val == "14" ) { pro_val = "Label Sticker"; }
	if (val == "15" ) { pro_val = "Letterhead"; }
	if (val == "16" ) { pro_val = "Mailing Services"; }
	if (val == "17" ) { pro_val = "Newsletter"; }
	if (val == "18" ) { pro_val = "Notepads"; }
	if (val == "19" ) { pro_val = "Other"; }
	if (val == "20" ) { pro_val = "Postcard"; }
	if (val == "21" ) { pro_val = "Poster"; }
	if (val == "22" ) { pro_val = "Presentation Folder"; }
	if (val == "23" ) { pro_val = "Rack Card"; }
    document.getElementById("Binders").style.display = 'none';
    document.getElementById("Brochure").style.display = 'none';
	document.getElementById("Business Cards").style.display = 'none';
	document.getElementById("Calendar").style.display = 'none';
	document.getElementById("Carbonless").style.display = 'none';
	document.getElementById("Catalog Booklet").style.display = 'none';
    document.getElementById("Concept Design").style.display = 'none';
	document.getElementById("Door Hanger").style.display = 'none';
	document.getElementById("Envelope Announcement").style.display = 'none';
	document.getElementById("Envelope Catalog").style.display = 'none';
	document.getElementById("Envelope Booklet").style.display = 'none';
    document.getElementById("Envelope Stationary").style.display = 'none';
	document.getElementById("Flyer").style.display = 'none';
	document.getElementById("Greeting Card").style.display = 'none';
	document.getElementById("Label Sticker").style.display = 'none';
	document.getElementById("Letterhead").style.display = 'none';
    document.getElementById("Mailing Services").style.display = 'none';
	document.getElementById("Newsletter").style.display = 'none';
	document.getElementById("Notepads").style.display = 'none';
	document.getElementById("Other").style.display = 'none';
	document.getElementById("Postcard").style.display = 'none';
    document.getElementById("Poster").style.display = 'none';
	document.getElementById("Presentation Folder").style.display = 'none';
	document.getElementById("Rack Card").style.display = 'none';
    document.getElementById(pro_val).style.display = '';
	//  }
   }
   function GetDisplayFunction(){
	document.getElementById("Dividers").style.display = 'inline';
	document.getElementById("Dividers2").style.display = 'inline';
   }
   function GetDisplayFunction_1(){
	document.getElementById("Dividers").style.display = 'none';
	document.getElementById("Dividers2").style.display = 'none';
   }


  function validate_submit(thisform)
  {
		if (document.test.firstname.value=="")
		{
			alert("Please enter First Name.");
			document.test.firstname.focus();
			return (false);
		}
		if (document.test.lastname.value=="")
		{
			alert("Please enter Last Name.");
			document.test.lastname.focus();
			return (false);
		}
	
		if (document.test.areacode.value=="")
		{
			alert("Please enter Area Code");
			document.test.areacode.focus();
			return (false);
		}
		if (document.test.phone.value=="")
		{
			alert("Please enter Phone No.");
			document.test.phone.focus();
			return (false);
		}
		if (document.test.email_address.value=="")
		{
			alert("Enter your valid Email address.");
			document.test.email_address.focus();
			return false;
		}
		var email=document.test.email_address.value;
		var x="/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/";
		if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)))
		{
			alert("Invalid E-mail");
			document.test.email_address.focus();
			document.test.email_address.select();
			return false;
		}
		/*if (document.test.phone.value=="")
		{
			alert("Please enter Phone No.");
			document.test.phone.focus();
			return (false);
		}	
		if (document.test.fax.value=="")
		{
			alert("Please enter Fax No.");
			document.test.fax.focus();
			return (false);
		}*/
		thisform.company_name.value = document.test.company_name.value;
		//thisform.client_name.value = document.test.client_name.value;
		thisform.email_address.value = document.test.email_address.value;
		thisform.phone.value = document.test.phone.value;
		//thisform.fax.value = document.test.fax.value;
		thisform.product_order.value = document.test.product_order.value;
		thisform.firstname.value = document.test.firstname.value;
		thisform.lastname.value = document.test.lastname.value;
		thisform.address.value = document.test.address.value;
		thisform.address_two.value = document.test.address_two.value;
		thisform.city.value = document.test.city.value;
		thisform.state.value = document.test.state.value;
		thisform.zip.value = document.test.zip.value;
		thisform.areacode.value = document.test.areacode.value;
		thisform.ext.value = document.test.ext.value;
		thisform.questions.value = document.test.questions.value;
		if(document.test.worked_with_cottrell[0].checked) {
			thisform.worked_with_cottrell.value = document.test.worked_with_cottrell[0].value;
		}
		if(document.test.worked_with_cottrell[1].checked) {
			thisform.worked_with_cottrell.value = document.test.worked_with_cottrell[1].value;
		}
		thisform.worked_with.value = document.test.worked_with.value;
				
 }

  function show_quantity(formname,cnt,fieldname){
	var val = formname.Wrapping_Boxing.selectedIndex;
	if(val >= cnt) {
		document.getElementById(fieldname).style.display = 'none';
	} else {
		document.getElementById(fieldname).style.display = '';
	}
   }
 
 