              var a;
			
			var childList1Data = {
				"A": ['- please choose -','10" x 12"', '12" x 15"', '16" x 20"','20" x 24"','24" x 30"','24" x 36" '],
				"B": ['- please choose -','3x3 - 0.060', '4x4 - 0.060','5x5 - 0.060','5x5 - 0.090','6x6 - 0.090',		
				'7x7 - 0.120','9x9 - 0.120','12x12 - 0.120', '14x14 - 0.197', '16x16 - 0.120','400mm - 0.197','20x20 - 0.197','24x24 – 0.197'],
				"C": ['- please choose -','3x3 - 0.090','4x4 - 0.090','5x5 - 0.060','7x7 - 0.120','9x9 - 0.120',
				'14x14 - 0.120','20x20 – 0.197'],
				"D": ['- please choose -','4x4 - 0.060','5x5 - 0.060','5x5 - 0.090','7x7 - 0.120','10x8 - 0.090','14x14 - 0.120','17x17 - 0.060','17x17 - 0.090','17x17 - 0.120', '24x20 - 0.197']
			};


			// Data for child list 2, this is a of the parent value to one or more options
		/*	var childList2Data = {
				"A": ['- please choose -','SUPER HIGH (128k)', 'HIGH (64k)','MEDIUM (32k)','LOW (16k)'],
				"B": ['- please choose -','SUPER HIGH (128k)', 'HIGH (64k)'],
				"C": ['- please choose -','SUPER HIGH (128k)','HIGH (64k)'],
				"D": ['Other']
				
			};*/
			
			// function for set Cookies
			function setCK()
            {
					
					function createCookie(value, days)
					{
						   //alert(value[2]);
							if (days) {
							//var date = new Date();
							//date.setTime(date.getTime()+(days));
							var expires = "; expires="+days.toGMTString();
							//alert(expires);
							}
							else var expires = "";
							for(i=0;i<value.length;i++){
							document.cookie = i+"="+value[i]+expires+"; path=/";}
							//alert("in create"+document.cookie);
					}
				  var expdate = new Date (); // pre-set to the current time and date
				  expdate.setTime(expdate.getTime() + 1000 * 60 * 60 * 24 * 365); // add one year to it 
				  companyv = document.getElementById('company').value;
				  userv = document.getElementById('user').value;
				  phonev = document.getElementById('phone').value;
				  emailv = document.getElementById('email').value;
				  del1 = document.getElementById('del1').value;
				  inv1 = document.getElementById('inv1').value;
				  var myarray = [companyv,userv,phonev,emailv,del1,inv1];
				  createCookie(myarray,expdate);
			}
             
			 // function for get Cookies
   
              function getCookie()
			  {
				   function readCookie(name)
				   {
						   //alert("in read"+document.cookie);
						   var ca = document.cookie.split(';');
						  
						   var nameEQ = name + "=";
						   for(var i=0; i < ca.length; i++) {
						   var c = ca[i];
						   //alert(c);
						   while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
						   if (c.indexOf(nameEQ) == 0){ 
						   return c.substring(nameEQ.length, c.length);
						   }
					 }
					  return null;
					}
				
				   if(readCookie(0)!=null)
				   {
					   document.getElementById('company').value = readCookie(0);
					   document.getElementById('user').value = readCookie(1);
					   document.getElementById('phone').value = readCookie(2);
					   document.getElementById('email').value = readCookie(3);
					   document.getElementById('del1').value = readCookie(4);
					   document.getElementById('inv1').value = readCookie(5);
                   }				   
			}
			
   
          // onchange is called when the parent value is changed
			function parentList_OnChange(objParentList,no,value) {
			  
				//a=value;
				if(no==1){
				var child1 = document.getElementById("childList1");
				var child2 = document.getElementById("childList2");
				var selObj = document.getElementById('Mask-1-Polarity1');
				selObj.selectedIndex = '0';
				
				}
				if(no==2){
				var child1 = document.getElementById("childList12");
				var child2 = document.getElementById("childList22");
				var selObj = document.getElementById('Mask-1-Polarity2');
				selObj.selectedIndex = '0';
				}
				if(no==3){
				var child1 = document.getElementById("childList13");
				var child2 = document.getElementById("childList23");
				var selObj = document.getElementById('Mask-1-Polarity3');
				selObj.selectedIndex = '0';
				}
				if(no==4){
				var child1 = document.getElementById("childList14");
				var child2 = document.getElementById("childList24");
				var selObj = document.getElementById('Mask-1-Polarity4');
				selObj.selectedIndex = '0';
				}
				if(no==5){
				var child1 = document.getElementById("childList15");
				var child2 = document.getElementById("childList25");
				var selObj = document.getElementById('Mask-1-Polarity5');
				selObj.selectedIndex = '0';
				}
				if(no==6){
				var child1 = document.getElementById("childList16");
				var child2 = document.getElementById("childList26");
				var selObj = document.getElementById('Mask-1-Polarity6');
				selObj.selectedIndex = '0';
				}
				if(no==7){
				var child1 = document.getElementById("childList17");
				var child2 = document.getElementById("childList27");
				var selObj = document.getElementById('Mask-1-Polarity7');
				selObj.selectedIndex = '0';
				}
				if(no==8){
				var child1 = document.getElementById("childList18");
				var child2 = document.getElementById("childList28");
				var selObj = document.getElementById('Mask-1-Polarity8');
				selObj.selectedIndex = '0';
				}
				if(no==9){
				var child1 = document.getElementById("childList19");
				var child2 = document.getElementById("childList29");
				var selObj = document.getElementById('Mask-1-Polarity9');
				selObj.selectedIndex = '0';
				}
				
			
			
				// Remove all options from both child lists
				removeOptions(child1);
				removeOptions(child2);
			
				// Lookup and get the array of values for child list 1, using the parents selected value
				if(objParentList.options[objParentList.selectedIndex].value=='Emulsion Film')
				var child1Data = childList1Data['A'];
				if(objParentList.options[objParentList.selectedIndex].value=='Chrome Soda Lime')
				var child1Data = childList1Data['B'];
				if(objParentList.options[objParentList.selectedIndex].value=='Chrome Quartz')
				var child1Data = childList1Data['C'];
				if(objParentList.options[objParentList.selectedIndex].value=='Emulsion Glass')
				var child1Data = childList1Data['D'];
			  
				// Add the options to child list 1
				if (child1Data) {
					for (var i = 0; i < child1Data.length; i++) {
						child1.options[i] = new Option(child1Data[i], child1Data[i]);
					}
				}
			
			
				// Do the same for the second list
				if(objParentList.options[objParentList.selectedIndex].value=='Emulsion Film')
				var child2Data = childList2Data['A'];
				if(objParentList.options[objParentList.selectedIndex].value=='Chrome Soda Lime')
				var child2Data = childList2Data['B'];
				if(objParentList.options[objParentList.selectedIndex].value=='Chrome Quartz')
				var child2Data = childList2Data['C'];
				if(objParentList.options[objParentList.selectedIndex].value=='Emulsion Glass')
				var child2Data = childList2Data['D'];
			
				if (child2Data) {
					for (var i = 0; i < child2Data.length; i++) {
						child2.options[i] = new Option(child2Data[i], child2Data[i]);
					}
				}
	}


	function removeOptions(objSelect) {
		while (objSelect.options.length > 0)
			objSelect.options[0] = null;
	}


		
	function change_case(id,no)
	{
		
		//alert('changecase'+no);
		  if(no==1)
		  a = document.getElementById('Mask-1-type').value;
		  if(no==2)
		  a = document.getElementById('Mask-1-type2').value;
		  if(no==3)
		  a = document.getElementById('Mask-1-type3').value;
		  if(no==4)
		  a = document.getElementById('Mask-1-type4').value;
		  if(no==5)
		  a = document.getElementById('Mask-1-type5').value;
		  if(no==6)
		  a = document.getElementById('Mask-1-type6').value;
		  if(no==7)
		  a = document.getElementById('Mask-1-type7').value;
		  if(no==8)
		  a = document.getElementById('Mask-1-type8').value;
		  if(no==9)
		  a = document.getElementById('Mask-1-type9').value;
		 // alert(a);
		  var numericExpression = /^[0-9]+$/;
	    
			ch = document.getElementById(id);
			//alert(ch.value);
			if(ch.value.match(numericExpression))
			{
				
					if(a=='Emulsion Film')
					{  
							if(ch.value>=1 && ch.value<=999)
							{
									if(ch.value>=1 && ch.value<=24 )
									{
										var val="C";
										parentList(val,no);
									}
									if(ch.value>=25 && ch.value<=49 )
									{
										var val="E";
										parentList(val,no);
									}
									if(ch.value>=50 && ch.value<=999 )
									{
										var val="A";
										parentList(val,no);
									}
									
							}
							else
							{
						       alert("wrong value");
							 }
					
					 }
					 else{
						    
							  if(no==1){
							  a = document.getElementById('Mask-1-type').value;
							  var selObjr = document.getElementById('childList2');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==2){
							  a = document.getElementById('Mask-1-type2').value;
							  var selObjr = document.getElementById('childList22');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==3){
							  a = document.getElementById('Mask-1-type3').value;
							  var selObjr = document.getElementById('childList23');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==4){
							  a = document.getElementById('Mask-1-type4').value;
							  var selObjr = document.getElementById('childList24');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==5){
							  a = document.getElementById('Mask-1-type5').value;
							  var selObjr = document.getElementById('childList25');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==6)
							  {
							  a = document.getElementById('Mask-1-type6').value;
							  var selObjr = document.getElementById('childList26');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==7)
							  {
							  a = document.getElementById('Mask-1-type7').value;
							  var selObjr = document.getElementById('childList27');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==8)
							  {
							  a = document.getElementById('Mask-1-type8').value;
							   var selObjr = document.getElementById('childList28');
				              selObjr.selectedIndex = '0';
							  }
							  if(no==9)
							  {
							  a = document.getElementById('Mask-1-type9').value;
							  var selObjr = document.getElementById('childList29');
				              selObjr.selectedIndex = '0';
							  }
							
							
						 
						 }
		}
		 else
		 {
			alert("please enter numeric value between 1-999");
		 }
	 
}



// Data for child list 2, this is a of the parent value to one or more options
var childList2Data = {
   
	"A": ['- please choose -','SUPER HIGH (128k)', 'HIGH (64k)','MEDIUM (32k)','LOW (16k)'],
    "B": ['- please choose -','SUPER HIGH (128k)', 'HIGH (64k)'],
    "C": ['- please choose -','SUPER HIGH (128k)','HIGH (64k)'],
	"D": ['- please choose -','SUPER HIGH (128k)','HIGH (64k)'],
	"E": ['- please choose -','SUPER HIGH (128k)','HIGH (64k)','MEDIUM (32k)']
    
};
		
function parentList(objParentList,no) {
  
               // alert(no);
				if(no==1){
				var child2 = document.getElementById("childList2");
				//removeOptions(child2);
				}
				if(no==2){
				
				var child2 = document.getElementById("childList22");
				//removeOptions(child2);
				}
				if(no==3){
				
				var child2 = document.getElementById("childList23");
				//removeOptions(child2);
				}
				if(no==4){
				
				var child2 = document.getElementById("childList24");
				//removeOptions(child2);
				}
				if(no==5){
				
				var child2 = document.getElementById("childList25");
				//removeOptions(child2);
				}
				if(no==6){
				
				var child2 = document.getElementById("childList26");
				//removeOptions(child2);
				}
				if(no==7){
				
				var child2 = document.getElementById("childList27");
				//removeOptions(child2);
				}
				if(no==8){
				
				var child2 = document.getElementById("childList28");
				//removeOptions(child2);
				}
				if(no==9){
				
				var child2 = document.getElementById("childList29");
				//removeOptions(child2);
				}
				//alert(child2.value);
				removeOptions(child2);
   
   
	
    var child2Data = childList2Data[objParentList];

    if (child2Data) {
        for (var i = 0; i < child2Data.length; i++) {
            child2.options[i] = new Option(child2Data[i], child2Data[i]);
        }
    }
}


function removeOptions(objSelect) {
    while (objSelect.options.length > 0)
        objSelect.options[0] = null;
}

function removetext()
{
   
   var str =  document.getElementById('note').value
   if(str=="any extra comments here......")
   document.getElementById('note').value = '';
}
function addtext()
{

 var str =  document.getElementById('note').value
 if(str=='')
 document.getElementById('note').value = 'any extra comments here......';

}


