function setVal(){
	for(i=0;i < document.form1.imp_verse_radio.length;i++){
		if(document.form1.imp_verse_radio[i].checked){
			selectval = document.form1.imp_verse_radio[i].value;
		}
	}	
	document.form1.imp_verse.text=selectval;
	document.form1.imp_verse.value=selectval;		
}

//checkChange() USED FOR NETSCAPE ONLY.
function checkChange(){
	var oValue = "";
	if(usertype > 2){
		oValue = document.form1.imp_verse.options[document.form1.imp_verse.selectedIndex].value;
	}else{
		oValue = document.form1.imp_verse.value;
	}
	
	if (oValue != "Custom"){
		//document.form1.imp_verse.focus();
		alert("You must select 'CREATE YOUR OWN MESSAGE' from 'Verse Selections' \n in order to create custom verses or select custom verse fonts.");
		document.form1.imp_customverse1.value = '';
		document.form1.imp_customverse2.value = '';
		document.form1.imp_customverse3.value = '';
		document.form1.imp_customverse4.value = '';
		document.form1.imp_customverse5.value = '';
		return false;
	}else{
		return true;
	}
}
//checkSelection() USED FOR CUSTOM VERSES ONLY.
function checkSelection(obj) {
	//check whether "Custom" has been selected. If so, make custom verse creation available to user.
	//var oBrowser = (navigator.appName.indexOf("Microsoft") != -1);
	var oName = obj.name;
	var oValue = "";
/*	
if(usertype > 2){
	oValue = document.form1.imp_verse.options[document.form1.imp_verse.selectedIndex].value
}else{
*/
	oValue = document.form1.imp_verse.value;

	//alert(oValue);
	//if (oBrowser){
		if (oValue == "Custom"){
			//document.form1.viewVerses.disabled = true;
			//document.form1.productid.value = document.form1.productid.value + "," + document.form1.CustomVerseID.value; //create a product array for kit purposes 
			document.getElementById('customVerses').style.display = '';		
			
		}
		else{
			//document.form1.viewVerses.disabled = false;
			document.getElementById('customVerses').style.display = 'none';			
		}
	//}else{ //clear custom values if user decides against custom verses
	//	if (oValue != "Custom"){
	//		document.form1.imp_customverse1.value = '';
	//		document.form1.imp_customverse2.value = '';
	//		document.form1.imp_customverse3.value = '';
	//		document.form1.imp_customverse4.value = '';
	//		document.form1.imp_customverse5.value = '';	
	//		document.form1.imp_verse_font.options[document.form1.imp_verse_font.selectedIndex].value ='Bellevue';
	//		document.form1.imp_verse_font.options[document.form1.imp_verse_font.selectedIndex].text ='Bellevue';
	//	}
	//}
}
//checkEmptyVerse() USED FOR CUSTOM VERSES ONLY.
function checkEmptyVerse(){
	//var oPlatform = navigator.platform;
	var selectval = "";
/*
if(usertype > 2){
	selectval = document.form1.imp_verse.options[document.form1.imp_verse.selectedIndex].value;
}else{
*/
	
	selectval = document.form1.imp_verse.value;
	
	if (selectval == ''){
		alert('Please select either a standard or custom verse.');
		return false;
	}
			
	if (selectval == "Custom"){
		if((document.form1.imp_customverse1.value == '') && (document.form1.imp_customverse2.value == '') && (document.form1.imp_customverse3.value == '') && (document.form1.imp_customverse4.value == '') && (document.form1.imp_customverse5.value == '')){
			alert('When creating your own verse, you must complete at least one line of custom text.');
			return false;
		}else{
			return true;
		}
	}	
	else {
		return true;
	}
}
//checkVerseFont() USED FOR CUSTOM VERSES ONLY.
function checkVerseFont(){
	//var oPlatform = navigator.platform;
	var selectval = "";
/*
if(usertype > 2){
	selectval = document.form1.imp_verse.options[document.form1.imp_verse.selectedIndex].value;
}else{
*/
	selectval = document.form1.imp_verse.value;
	
	if (selectval == "Custom"){
		if(document.form1.imp_verse_font.value == ''){
			alert('Please select a font style for your custom verses.');
			return false;
		}
		else{
			return true;
		}
	}	
	else {
		return true;
	}	
}
function checkVerseKitORIG(obj){
	var selectval = "";
/*
if(usertype > 2){
	selectval = document.form1.imp_verse.options[document.form1.imp_verse.selectedIndex].value;
}else{
*/
	selectval = document.form1.imp_verse.value;
				
	if (selectval == "Custom"){	
		if(document.form1.kittedVerse.value != 'yes'){			
			productNumber = ++productNumber;	//updating the global variable
			document.form1.productid.value = addProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
			document.form1.kittedVerse.value = 'yes'; //set the kitted flag to prevent repeat submission of the same kit item. 
		}	
	}
	else {
		if (document.form1.kittedVerse.value == 'yes'){
			document.form1.kittedVerse.value = ''; //set the kitted flag		
			productNumber = --productNumber	//updating the global variable
			document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
		}		
	}
	//alert('in checkVerseKit selectval = ' + selectval);
	checkKitID();		
	//alert('\n' + 'selectval=' + selectval + '\n' + 'productNumber=' + productNumber + '\n' + 'prodid=' + document.form1.productid.value  + '\n' + 'kitval=' + document.form1.kittedVerse.value);
}

function checkVerseKit(){
	//alert('test=' + oKit.productid);
	var selectval = '';
	
	for(i=0;i < document.form1.imp_verse_radio.length;i++){
		if(document.form1.imp_verse_radio[i].checked){
			selectval = document.form1.imp_verse_radio[i].value;
		}
	}
	//alert('in checkVerseKit selectval = ' + selectval);	
	
	switch(selectval){
		case 'Custom':
			if(document.form1.kittedVerse_Custom.value != 'yes'){			
				productNumber = ++productNumber;	//updating the global variable
				document.form1.productid.value = addProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
				document.form1.kittedVerse.value = 'yes'; //set the kitted flag to prevent repeat submission of the same kit item. 
			}else{ 		
				document.form1.kittedVerse_Custom.value = ''; //set the kitted flag		
				productNumber = --productNumber	//updating the global variable
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.UploadID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.OnFileID.value);
			}
			break;
		case 'Upload':
			if(document.form1.kittedVerse_Upload.value != 'yes'){			
				productNumber = ++productNumber;	//updating the global variable
				document.form1.productid.value = addProdID(document.form1.productid.value,document.form1.UploadID.value);
				document.form1.kittedVerse.value = 'yes'; //set the kitted flag to prevent repeat submission of the same kit item. 
			}else{ 		
				document.form1.kittedVerse_Upload.value = ''; //set the kitted flag		
				productNumber = --productNumber	//updating the global variable
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.UploadID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.OnFileID.value);
			}
			break;		
		case 'On File':
			if(document.form1.kittedVerse_OnFile.value != 'yes'){			
				productNumber = ++productNumber;	//updating the global variable
				document.form1.productid.value = addProdID(document.form1.productid.value,document.form1.OnFileID.value);
				document.form1.kittedVerse.value = 'yes'; //set the kitted flag to prevent repeat submission of the same kit item. 
			}else{ 		
				document.form1.kittedVerse_OnFile.value = ''; //set the kitted flag		
				productNumber = --productNumber	//updating the global variable
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.UploadID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.OnFileID.value);
			}
			break;
		case 'Standard':
			if(document.form1.kittedVerse.value != 'yes'){					
			}else{ 		
				document.form1.kittedVerse.value = ''; //set the kitted flag		
				productNumber = --productNumber	//updating the global variable
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.UploadID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.OnFileID.value);
			}
			break;
		case 'No Verse':
			if(document.form1.kittedVerse_No.value != 'yes'){			
			// check to see if the color or signature or font imprints are null than prompt them.
			//alert(document.form1.usertype.value);
				var bSignature = 'false';
				var bInkcolor = 'false';
				
				 // signature check.
				//  for(i=1;i < 4; i++){
				//		if(eval('document.form1.imp_signature' + [i] + '.value') != '')
				//		{
				//			var bSignature = 'true';
				//		}
				//	}	
					
				  // ink color check.
				  if (document.form1.imp_ink_color) 
				  {
				  for(i=0;i < document.form1.imp_ink_color.length;i++){
						if(document.form1.imp_ink_color[i].checked){
								var bInkcolor = 'true';
						}
					}	
				}
				  //alert("bInkcolor: "  + bInkcolor + " bSignature: " + bSignature);
				  //alert("document.form1.imp_signature_font.value " + document.form1.imp_signature_font.value);
				  //font check and whole check of all three
				  if (document.form1.imp_ink_color) 
				  {
				//	if( document.form1.imp_signature_font.value == '' || bInkcolor == 'false' ||  bSignature == 'false' )
				if(bInkcolor == 'false')
					{
						//alert("validation is ok");
						if(!confirm("Tha card color is not specified.Are you sure you want to continue?"))
						{
							//alert ("answered no");
							return false;
						}						
					}		
				}	
			}else{ 		
				document.form1.kittedVerse_No.value = ''; //set the kitted flag		
				productNumber = --productNumber	//updating the global variable
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.CustomVerseID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.UploadID.value);
				document.form1.productid.value = remProdID(document.form1.productid.value,document.form1.OnFileID.value);
			}
			break;
		default:
			break;
	}	
	
	checkKitID();		
	//alert('\n' + 'selectval=' + selectval + '\n' + 'productNumber=' + productNumber + '\n' + 'prodid=' + document.form1.productid.value  + '\n' + 'kitval=' + document.form1.kittedVerse.value);
	
	return true;
}

//oImprint.checkEmptyVerse=checkEmptyVerse;
//oImprint.checkVerseFont=checkVerseFont;
//oImprint.checkVerseKit = checkVerseKit;

verse.checkEmptyVerse=checkEmptyVerse;
verse.checkVerseFont=checkVerseFont;
verse.checkVerseKit = checkVerseKit;


