function openNewsReleaseEmail(list_id,company_name,company_id) {
	dayWindow=window.open('http://cnrp.ccnmatthews.com/client/signup_forms/newsReleaseEmail.jsp?list_id='+list_id+'&company_name='+company_name+'&company_id='+company_id+'', 'newWin1','width=500,height=500,resizable=1')
	dayWindow.focus();
}

function openNewsReleaseEmailShort(list_id,company_name,company_id) {
	dayWindow=window.open('http://cnrp.ccnmatthews.com/client/signup_forms/newsReleaseEmailShort.jsp?list_id='+list_id+'&company_name='+company_name+'&company_id='+company_id+'', 'newWin1','width=500,height=500,resizable=1')
	dayWindow.focus();
}

function openfr_NewsReleaseEmailShort(list_id,company_name,company_id) {
	dayWindow=window.open('http://cnrp.ccnmatthews.com/client/signup_forms/fr_newsReleaseEmailShort.jsp?list_id='+list_id+'&company_name='+company_name+'&company_id='+company_id+'', 'newWin1','width=500,height=500,resizable=1')
	dayWindow.focus();
}

function openNewsReleaseLink(list_id,company_name,company_id) {
	dayWindow=window.open('http://cnrp.ccnmatthews.com/client/signup_forms/newsReleaseLink.jsp?list_id='+list_id+'&company_name='+company_name+'&company_id='+company_id+'', 'newWin2','width=500,height=500,resizable=1')
	dayWindow.focus();
}

function openNewsReleaseLinkShort(list_id,company_name,company_id) {
	dayWindow=window.open('http://cnrp.ccnmatthews.com/client/signup_forms/newsReleaseLinkShort.jsp?list_id='+list_id+'&company_name='+company_name+'&company_id='+company_id+'', 'newWin2','width=500,height=500,resizable=1')
	dayWindow.focus();
}

function openFax(list_id,company_name,company_id) {
	dayWindow=window.open('http://cnrp.ccnmatthews.com/client/signup_forms/newsReleaseFax.jsp?list_id='+list_id+'&company_name='+company_name+'&company_id='+company_id+'', 'newWin3','width=500,height=500,resizable=1')
	dayWindow.focus();
}

function openFaxShort(list_id,company_name,company_id) {
	dayWindow=window.open('http://cnrp.ccnmatthews.com/client/signup_forms/newsReleaseFaxShort.jsp?list_id='+list_id+'&company_name='+company_name+'&company_id='+company_id+'', 'newWin3','width=500,height=500,resizable=1')
	dayWindow.focus();
}
	
	
/* opens up the large photo*/	
function openNewWindow(link,windowName,width,height,scrollbars,menubar,resizable) {
newWindow=window.open(link, windowName,'width='+width+',height='+height+',menubar='+menubar+',resizable='+resizable+',scrollbars='+scrollbars+',top=125')
newWindow.focus();
}

/* opens up new window with menubar*/	
function openNewWindowMenu(link,windowName,width,height,scrollbars,menubar,resizable) {
newWindow=window.open(link, windowName,'width='+width+',height='+height+',menubar='+menubar+',resizable='+resizable+',scrollbars='+scrollbars+',top=125')
newWindow.focus();
}

function printWindow(){
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) window.print();
}

/* checkAutoHotwLogin - checks hotw login form - for signing up for this client*/		
		
function checkAutoHotwLogin(form) {
	var a = form.username.value;
	var b = form.password.value;
	var c = form.actionFor.value;
	
    
    if(a == ""){
		alert("Please enter your email address to signup this company to your HOTW account.");
		form.username.focus();

    }else if(b == ""){
		alert("Please enter your password to signup this company to your HOTW account.");
		form.password.focus();

    }else{
		form.method="post";
		form.target="_self";
		form.action="http://cnrp.ccnmatthews.com/client/cnrp.Controller?action=hotwSignup&actionFor="+c+"";
		form.submit();
    }
}
	
		
	function checkReleaseEmail(form) { 
		
		var fName = form.firstname.value;
		var lName = form.lastname.value;
		var comp = form.company.value;
		var checkEmail = form.email.value;
		var phn = form.phone.value;
		var best = form.best_desc.options[form.best_desc.selectedIndex].value;
		var otherbox = form.otherbox.value;
		
		if(fName == ""){
			alert("Please enter your First Name.");
			form.firstname.focus();
		}else if(lName == ""){
			alert("Please enter your Last Name.");
			form.lastname.focus();		
		}else if(comp == ""){
			alert("Please enter your Company Name.");
			form.company.focus();
		}else if(checkEmail == ""){
			alert("Please enter your Email Address.");
			form.email.focus();			
		}else if((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-5) != '.') && (checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) {		
			alert("You have entered an incorrect email address.  Please try again.");
			form.email.focus();
		}else if(phn == ""){
			alert("Please enter your Phone Number.");
			form.phone.focus();		
		}else if(best == "other" && otherbox == ""){
			alert("If you select Other from the \"Which description fits you best?\" drop down menu, you are required to fill in the Other text box.");
			form.otherbox.focus();						
		}else{
			form.method="post";
			form.target="_self";
			form.action="http://cnrp.ccnmatthews.com/client/cnrp.Controller?action=signup4EmailList";
			form.submit();
		}
	}
	
	
	function checkReleaseEmailShort(form) { 
		
		var fName = form.firstname.value;
		var lName = form.lastname.value;
		var checkEmail = form.email.value;
		
		
		if(fName == ""){
			alert("Please enter your First Name.");
			form.firstname.focus();
		}else if(lName == ""){
			alert("Please enter your Last Name.");
			form.lastname.focus();		
		
		}else if(checkEmail == ""){
			alert("Please enter your Email Address.");
			form.email.focus();			
		}else if((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-5) != '.') && (checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) {		
			alert("You have entered an incorrect email address.  Please try again.");
			form.email.focus();					
		}else{
			form.method="post";
			form.target="_self";
			form.action="http://cnrp.ccnmatthews.com/client/cnrp.Controller?action=signup4EmailListShort";
			form.submit();
		}
	}	
		
	function checkReleaseFax(form) { 
		
		var fName = form.firstname.value;
		var lName = form.lastname.value;
		var comp = form.company.value;		
		var checkEmail = form.email.value;
		var areaFax = form.areaFax.value;
		var exchangeFax = form.exchangeFax.value;
		var numberFax = form.numberFax.value;
		var phn = form.phone.value;
		var best = form.best_desc.options[form.best_desc.selectedIndex].value;
		var otherbox = form.otherbox.value;
		var IsNumber=true;
		var Char;
		var ValidChars = "0123456789";
		var h = 0;
		var j = 0;
		var k = 0;
		
		
		for (i = 0; i < areaFax.length && IsNumber == true; i++) {
			Char = areaFax.charAt(i);
			if (ValidChars.indexOf(Char) == -1){
				h = 1;
      			}
		}
		
		for (i = 0; i < exchangeFax.length && IsNumber == true; i++) {
			Char = exchangeFax.charAt(i);
			if (ValidChars.indexOf(Char) == -1){
				j = 1;
      			}
		}		
		
		for (i = 0; i < numberFax.length && IsNumber == true; i++) {
			Char = numberFax.charAt(i);
			if (ValidChars.indexOf(Char) == -1){
				k = 1;
      			}
		}		
		
		if(fName == ""){
			alert("Please enter your First Name.");
			form.firstname.focus();
		}else if(lName == ""){
			alert("Please enter your Last Name.");
			form.lastname.focus();		
		}else if(comp == ""){
			alert("Please enter your Company Name.");
			form.company.focus();
		}else if(phn == ""){
			alert("Please enter your Phone Number.");
			form.phone.focus();	
		}else if(areaFax == ""){
			alert("Please enter the Area Code Field.");
			form.areaFax.focus();
   		}else if (h == 1){
   			alert("Please enter only numbers in the Area Code Field."); //Informs user of empty field
   			form.areaFax.focus();
   			form.areaFax.value="";
		}else if(exchangeFax == ""){
			alert("Please enter the Exchange Code Field.");
			form.exchangeFax.focus();
   		}else if (j == 1){
   			alert("Please enter only numbers in the Exchange Code Field."); //Informs user of empty field
   			form.exchangeFax.focus();
   			form.exchangeFax.value="";
		}else if(numberFax == ""){
			alert("Please enter the Number Field.");
			form.numberFax.focus();	
   		}else if (k == 1){
   			alert("Please enter only numbers in the Number Field."); //Informs user of empty field
   			form.numberFax.focus();
   			form.exchangeFax.value="";			
		}else if(best == "other" && otherbox == ""){
			alert("If you select Other from the \"Which description fits you best?\" drop down menu, you are required to fill in the Other text box.");
			form.otherbox.focus();						
		}else{
			if(checkEmail !=""){
				if((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-5) != '.') && (checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) {		
					alert("You have entered an incorrect email address.  Please try again.");
					form.email.focus();		
					form.email.value="";
				}else{			
					form.method="post";
					form.target="_self";
					form.action="http://cnrp.ccnmatthews.com/client/cnrp.Controller?action=signup4FaxList";
					form.submit();
				}
			}else{
				form.method="post";
				form.target="_self";
				form.action="http://cnrp.ccnmatthews.com/client/cnrp.Controller?action=signup4FaxList";
				form.submit();				
			}
			
					
		}
	}	


	function checkReleaseFaxShort(form) { 
		
		var fName = form.firstname.value;
		var lName = form.lastname.value;
		var areaFax = form.areaFax.value;
		var exchangeFax = form.exchangeFax.value;
		var numberFax = form.numberFax.value;
		var IsNumber=true;
		var Char;
		var ValidChars = "0123456789";
		var h = 0;
		var j = 0;
		var k = 0;
		
		
		for (i = 0; i < areaFax.length && IsNumber == true; i++) {
			Char = areaFax.charAt(i);
			if (ValidChars.indexOf(Char) == -1){
				h = 1;
      			}
		}
		
		for (i = 0; i < exchangeFax.length && IsNumber == true; i++) {
			Char = exchangeFax.charAt(i);
			if (ValidChars.indexOf(Char) == -1){
				j = 1;
      			}
		}		
		
		for (i = 0; i < numberFax.length && IsNumber == true; i++) {
			Char = numberFax.charAt(i);
			if (ValidChars.indexOf(Char) == -1){
				k = 1;
      			}
		}		
		
		if(fName == ""){
			alert("Please enter your First Name.");
			form.firstname.focus();
		}else if(lName == ""){
			alert("Please enter your Last Name.");
			form.lastname.focus();		
		}else if(areaFax == ""){
			alert("Please enter the Area Code Field.");
			form.areaFax.focus();
   		}else if (h == 1){
   			alert("Please enter only numbers in the Area Code Field."); //Informs user of empty field
   			form.areaFax.focus();
   			form.areaFax.value="";
		}else if(exchangeFax == ""){
			alert("Please enter the Exchange Code Field.");
			form.exchangeFax.focus();
   		}else if (j == 1){
   			alert("Please enter only numbers in the Exchange Code Field."); //Informs user of empty field
   			form.exchangeFax.focus();
   			form.exchangeFax.value="";
		}else if(numberFax == ""){
			alert("Please enter the Number Field.");
			form.numberFax.focus();	
   		}else if (k == 1){
   			alert("Please enter only numbers in the Number Field."); //Informs user of empty field
   			form.numberFax.focus();
   			form.exchangeFax.value="";			
		}else{
			form.method="post";
			form.target="_self";
			form.action="http://cnrp.ccnmatthews.com/client/cnrp.Controller?action=signup4FaxListShort";
			form.submit();				
		}
			
					
	}	