function formCheck(mode, description)
{ 
var MyFocus;
		
	if ((mode == "SHORT") || (mode == "ABBR"))
	{
	return true;
	}

	if (mode == "ADD")
	{
		if (document.forms[0].FNAME.value == "")
		{
			alert ("Please specify your First name.");
        		document.forms[0].FNAME.focus();
			return false;
		}
		if (document.forms[0].LNAME.value == "")
		{
			alert("Please specify your Last name.");
        		document.forms[0].LNAME.focus();
			return false; 
		}
	}
	if (mode != "RENEW")
	{
		if (document.forms[0].TITLE.value == "")
		{
			alert("Please specify your Title.");
	        	document.forms[0].TITLE.focus();
			return false;
		}
		if (document.forms[0].COMPANY.value == "")
		{
			alert("Please specify your company.");
	                document.forms[0].COMPANY.focus();
			return false;
		}
				
		if (document.forms[0].ADDRESS2.value == "")
		{
			alert("Please specify your Street Address.");
	        	document.forms[0].ADDRESS2.focus();
			return false;
		}
		if (document.forms[0].CITY.value == "")
		{
			alert("Please specify your City.");
	        	document.forms[0].CITY.focus();
			return false;
		}
		if (document.forms[0].STATE.selectedIndex == 0)
		{
			alert("Please specify your State/Province or select 'I am not in the US or Canada'.");
		        document.forms[0].STATE.focus();
			return false;
		}

		// validate Canadian state/postal code combination
		if (!ValidCanPostal(document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value,document.forms[0].ZIPCODE.value))
		{
			alert ("Invalid Canadian province/postal code combination.");
        		document.forms[0].STATE.focus();
			return false;
		}

		if (document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value == "53")
		{
			if (document.forms[0].COUNTRY.value == "")
			{
				alert("Please specify your Country.");
	        		document.forms[0].COUNTRY.focus();
				return false;
			}
		}
		else
		{
			if (document.forms[0].ZIPCODE.value.length < 5)
			{
				alert("Please specify your Zip/Postal Code.");
	        		document.forms[0].ZIPCODE.focus();
				return false;
			}
		}
	}
	if (document.forms[0].PHONE.value == "") 
	{
		alert ("Please specify your phone.");
		document.forms[0].PHONE.focus();
		return false;
	}
	if (document.forms[0].EMAIL_ADDRESS.value == "")
	{
		alert ("Please specify your E-mail Address.");
        	document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}
	if (!validEmail(document.forms[0].EMAIL_ADDRESS.value))
	{
			alert ("You have entered an invalid email address. Please re-enter it.");
			document.forms[0].EMAIL_ADDRESS.focus();
			return false;
	}


	if (ObjectExists(document.forms[0], "IT_ROLE"))
	{
		if (document.forms[0].IT_ROLE.value=="01")
		{
	        	if (!DemoBlockIT(mode))
			{
				return false;
			}
		}

		if (document.forms[0].IT_ROLE.value=="02")
		{
                	if (!DemoBlockVEND(mode))
			{
				return false;
			}
		}
		if (document.forms[0].IT_ROLE.value=="")
		{
			if (!DemoBlockIT(mode))
			{
				return false;
			}
		}
	}
	return true;
}  

function formCheckP2(mode)
{
	if (document.forms[0].TITLE.value == "")
	{
		alert ("Please specify your Title.");
	        document.forms[0].TITLE.focus();
		return false;
	}
	if (document.forms[0].COMPANY.value == "")
	{
		alert ("Please specify your Company name.");
		document.forms[0].COMPANY.focus();
		return false;
	}
	if (document.forms[0].ADDRESS2.value == "")
	{
		alert ("Please specify your Street Address.");
	        document.forms[0].ADDRESS2.focus();
		return false;
	}
	if (document.forms[0].CITY.value == "")
	{
		alert ("Please specify your City.");
	        document.forms[0].CITY.focus();
		return false;
	}
        if (ObjectExists(document.forms[0],"STATE"))
	{
		if (document.forms[0].STATE.selectedIndex == 0)
		{
		alert ("Please specify your State/Province.");
		document.forms[0].STATE.focus();
		return false;
		}

	// validate Canadian state/postal code combination
	if (!ValidCanPostal(document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value,document.forms[0].ZIPCODE.value))
	{
		alert ("Invalid Canadian province/postal code combination.");
		document.forms[0].STATE.focus();
		return false;
	}

	if (document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value == "53")

		{
			if (document.forms[0].COUNTRY.value == "")
			{
				alert("Please specify your Country.");
	        		document.forms[0].COUNTRY.focus();
				return false;
			}
		}
		else
		{
			if (document.forms[0].ZIPCODE.value.length < 5)
			{
				alert("Please specify your Zip/Postal Code.");
	        		document.forms[0].ZIPCODE.focus();
				return false;
			}
		}
         }

	if (document.forms[0].PHONE.value == "") 
	{
		alert ("Please specify your phone.");
		document.forms[0].PHONE.focus();
		return false;
	}
	
	if (ObjectExists(document.forms[0],"IT_ROLE"))
	{
		if (document.forms[0].IT_ROLE.value=="02")
       		{
			if (!DemoBlockVEND(mode))
			{
				return false;
			}
		}
		if (document.forms[0].IT_ROLE.value=="01")
		{
			if (!DemoBlockIT(mode))
			{
				return false;
			}
		
		}
	}
	return true;
}

// declare global variables
var i;

// two arrays for Canadian province/postal code validation
var CanCodes=new Array("54","55","56","57","58","59","60","66","61","62","63","64","65");
var CanLetters=new Array("T","UV","R","E","A","B","X","X","KLMNP","C","GHJ","S","Y");

// check if first letter of postal code matches selected Canadian province
// StateCD is 2-digit code that Omeda uses to identify Canadian provinces (value of STATE field)
// PostCD is entered postal code (value of ZIPCODE field)
function ValidCanPostal(StateCD, PostCD)
{
	var fletter=PostCD.substring(0,1);
	fletter = fletter.toUpperCase();

	for(i=0;i<13;i++)
	{
		if (StateCD==CanCodes[i])
		{
			if (CanLetters[i].indexOf(fletter,0) == -1)
			{
				return false;
			}
			else
			{
				return true;
			}
		}
	}
	return true;
}

function checkEmailValue(emailValue)
{     //runs the validate script and returns error box or nonerror

	if (emailValue == "")
	{
		alert("You have not entered email address. Please re-enter it.");
		return false;
	}

	startPos = 0;

	commaPos = emailValue.indexOf(",",startPos+1);	//position of semicolomn
	while (commaPos != -1)
	{
		endPos = commaPos;
		emailElement = emailValue.substring(startPos,endPos);
		if(!validEmail(emailElement))
		{
			alert("You have entered an invalid email address. Please re-enter it.");
			return false;
		}
		startPos = endPos + 1;		
		commaPos = emailValue.indexOf(",",startPos);	//position of semicolomn
	}
	endPos = emailValue.length;
	emailElement = emailValue.substring(startPos,endPos);

	if(!validEmail(emailElement))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		return false;
	}
	return true;		
}
function checkSingleEmailValue(emailValue)
{     //runs the validate script and returns error box or nonerror

	if (emailValue == "")
	{
		alert("You have not entered email address. Please re-enter it.");
		return false;
	}

	if(!validEmail(emailValue))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.SendEmail.send_to.focus();
		return false;
	}
	return true;		
}								

function validEmail(email)
{
	invalidchars = " /:;,"

	if(email == "")
	{			//checks to see if blank field
		return false
	}
			
	for(i=0;i<invalidchars.length;i++)
	{ //checks for invalid chars
			
		badchars = invalidchars.charAt(i)
			
		if(email.indexOf(badchars,0)!= -1)
		{
			return false
		}	
	}
	
	atPos = email.indexOf("@",1)  //holds position of "@"
			
	if(atPos == -1) 
	{	//checks to see if "@" present
		return false
	}
							
	if(email.indexOf("@",atPos+1) != -1) 
	{ //checks for second "@"
		return false
	}
							
	periodPos = email.indexOf(".",atPos) //holds position of "."
			
	if(periodPos == -1)
	{ //checks for presence of "."
		return false
	}
	if(periodPos+3 > email.length)
	{//makes sure at least two chars after the period
		return false
	}
	return true 
}
function checkDropdown(selectBox)
{

	if (selectBox.selectedIndex == 0)
	{
		return false;
	}
	else
	{
		return true;
	}
}

function CheckUnselects(radioItem)
{
	for(i=0;i<radioItem.length;i++)
	{
		if(radioItem[i].checked)
		{
			return true;
		}//end if
	}//end for
	return false;
}

function CheckedRadioValue(radioItem)
{
	for(i=0;i<radioItem.length;i++)
	{
		if(radioItem[i].checked)
		{
			return radioItem[i].value;
		}//end if
	}//end for
	return false;
}

function ValidNum(NumObj)
{
	var myNum, cleanNum;
	
	myNum = NumObj.value
	cleanNum = parseInt(myNum);

	if ( myNum == "")
	{
		return true;
	}
       	if(myNum != cleanNum)
	
	{
		alert("You have entered an invalid number.Please re-enter.");
		NumObj.focus();
		return false;
	}
	return true;
}
function checkEmailValuePA(emailValue)
{     //runs the validate script and returns error box or nonerror

	if (emailValue == "")
	{
		//alert("You have not entered email address. Please re-enter it.");
		return true;
	}

	startPos = 0;

	commaPos = emailValue.indexOf(",",startPos+1);	//position of semicolomn
	while (commaPos != -1)
	{
		endPos = commaPos;
		emailElement = emailValue.substring(startPos,endPos);
		if(!validEmail(emailElement))
		{
			alert("You have entered an invalid email address. Please re-enter it.");
			return false;
		}
		startPos = endPos + 1;		
		commaPos = emailValue.indexOf(",",startPos);	//position of semicolomn
	}
	endPos = emailValue.length;
	emailElement = emailValue.substring(startPos,endPos);

	if(!validEmail(emailElement))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		return false;
	}
	return true;		
}
function checkConfirmEmail()
{
	if ((document.forms[0].email1.value != "") && (!validEmail(document.forms[0].email1.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].email1.focus();
		return false;
	}
	if ((document.forms[0].email2.value != "") && (!validEmail(document.forms[0].email2.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].email2.focus();
		return false;
	}
	if ((document.forms[0].email3.value != "") && (!validEmail(document.forms[0].email3.value)))
	{
		alert ("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].email3.focus();
		return false;
	}
	
	
}
function LoginFormCheck()
{ 
	if(document.forms[0].HAVE_RDRNUM[0].checked == false && document.forms[0].HAVE_RDRNUM[1].checked == false)
	{
			alert ("Please specify whether you have an account number.");
        		document.forms[0].HAVE_RDRNUM[0].focus();
			return false;
		}
	if(document.forms[0].HAVE_RDRNUM[0].checked == true && document.forms[0].RDRNUM.value == "")
		{
			alert ("Please enter your account number.");
       			document.forms[0].RDRNUM.focus();
			return false;
		}

 	if(document.forms[0].HAVE_RDRNUM[0].checked == true && document.forms[0].LNAME_FIRST4.value == "")
		{
			alert ("Please enter first 4 letters of your last name.");
       			document.forms[0].LNAME_FIRST4.focus();
			return false;
		}
	if(document.forms[0].HAVE_RDRNUM[1].checked == true && document.forms[0].EMAIL_ADDRESS_LOGIN.value == "")
		{
			alert ("Please specify your E-mail Address.");
       			document.forms[0].EMAIL_ADDRESS_LOGIN.focus();
			return false;
		}
                 
	if ((document.forms[0].EMAIL_ADDRESS_LOGIN.value != "") && (!validEmail(document.forms[0].EMAIL_ADDRESS_LOGIN.value)))
	      {
		    alert ("You have entered an invalid email address. Please re-enter it.");
		    document.forms[0].EMAIL_ADDRESS_LOGIN.focus();
		    return false;
	      }
	if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert ("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		}

	if (!CheckUnselects(document.forms[0].IT_MANAGE))
		{
		       alert ("Please specify if you manage, evaluate or recommend storage software or services?");
			document.forms[0].IT_MANAGE[0].focus();
			return false;
		}
	if (!CheckUnselects(document.forms[0].IT_ROLE))
		{
			alert ("Please specify your role.");
			document.forms[0].IT_ROLE[0].focus();
			return false;
		}
	if (document.forms[0].COMPANY_LOGIN.value == "")
		{
			alert ("Please specify your company.");
        		document.forms[0].COMPANY_LOGIN.focus();
			return false;
		}
	return true;
}

function DemoBlockIT(mode)
{
	if (mode != "ADD")
	{

    		if (!CheckUnselects(document.forms[0].RECEIVE_YES_NO))
    		{
    			alert("Please specify whether you wish to receive Storage Magazine.");
            		document.forms[0].RECEIVE_YES_NO[0].focus();
    			return false;
    		}

    		if (!CheckUnselects(document.forms[0].IT_MANAGE))
    		{
    			alert("Please specify if you manage, evaluate or recommend storage software or services?");
    			document.forms[0].IT_MANAGE[0].focus();
    			return false;
    		}
	}
       	


	
	


// question 1
	
	if (ObjectExists(document.forms[0],"IT_EMPL_COMPANY"))
	{
		if (!checkDropdown(document.forms[0].IT_EMPL_COMPANY))
		{
			alert ("Please select the total number of employees at your company.");
			document.forms[0].IT_EMPL_COMPANY.focus();
			return false;
		}
	}	



// question 2
	if (ObjectExists(document.forms[0],"IT_TERABYTES_LOCATION"))
	{
		if (!checkDropdown(document.forms[0].IT_TERABYTES_LOCATION))
		{
		alert ("Please select the total terabytes of storage installed at your location.");
		document.forms[0].IT_TERABYTES_LOCATION.focus();
		return false;
		}	
	}
// question 3
	if (ObjectExists(document.forms[0],"IT_ANNUAL_EXPENDITURE"))
	{
		if (!checkDropdown(document.forms[0].IT_ANNUAL_EXPENDITURE))
		{
		alert ("Please select your average annual expenditure on storage.");
		document.forms[0].IT_ANNUAL_EXPENDITURE.focus();
		return false;
		}	
        }

//question 4
if (ObjectExists(document.forms[0],"IT_INDUSTRY"))
	{
		if (!checkDropdown(document.forms[0].IT_INDUSTRY))
		{
		alert ("Please select categories that best reflects your organization's industry.");
		document.forms[0].IT_INDUSTRY.focus();
		return false;
		}

		//if //((document.forms[0].IT_INDUSTRY[document.forms[0].IT_INDUSTRY.selectedIndex].value == '98')&& //(document.forms[0].IT_INDUSTRY_DESC.value == ''))
	//	{
	//	alert ("Please specify your organization's industry description.");
	//	document.forms[0].IT_INDUSTRY_DESC.focus();
	//	return false;
	//	}
       }
//question 5

	if (ObjectExists(document.forms[0],"IT_SPECIFY-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_SPECIFY'))
		{
			alert ("Please check your role in purchasing.");
			myFocus=document.getElementById("IT_SPECIFY");
			myFocus.scrollIntoView(true);
			return false;
		}
	}

//question 6
     if (ObjectExists(document.forms[0],"IT_OPERATING_SYSTEMS-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_OPERATING_SYSTEMS'))
		{
		alert ("Please specify your IT operating systems.");
		myFocus=document.getElementById("IT_OPERATING_SYSTEMS");
		myFocus.scrollIntoView(true);
		return false;
		}	
		if (document.getElementById('IT_OPERATING_SYSTEMS98').checked)
		{
			if (document.forms[0].IT_OP_SYS_TXT.value == '')
			{ 
			alert ("Please specify your IT operating systems - other.");
			myFocus=document.getElementById("IT_OPERATING_SYSTEMS");
			myFocus.scrollIntoView(true); 
			document.forms[0].IT_OP_SYS_TXT.focus();
			return false;
			}
		}
      }
//question 7
	if (ObjectExists(document.forms[0],"IT_PRODUCTS_CONSIDER-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_PRODUCTS_CONSIDER'))
		{
		alert ("Please specify your IT products consider.");
		myFocus=document.getElementById("IT_PRODUCTS_CONSIDER");
		myFocus.scrollIntoView(true);
		return false;
		}
		if (document.getElementById('IT_PRODUCTS_CONSIDER98').checked)
		{
		   if (document.forms[0].IT_PROD_CONSIDER_TXT.value == '')
 		    {
			alert("Please specify your IT products consider - other.");
			myFocus=document.getElementById("IT_PRODUCTS_CONSIDER");
			myFocus.scrollIntoView(true);
			document.forms[0].IT_PROD_CONSIDER_TXT.focus();
			return false;
		     }
	         }
         }
//question 8
	if (ObjectExists(document.forms[0],"IT_CURRENTLY_USE-01"))
	{
	if (!CheckboxChecked(document.forms[0],'IT_CURRENTLY_USE'))
	{
		alert ("Please check the vendor's storage products/services do you currently use.");
		myFocus=document.getElementById("IT_CURRENTLY_USE");
		myFocus.scrollIntoView(true);
		return false;
	}

	if (document.getElementById('IT_CURRENTLY_USE98').checked)
	{
		if (document.forms[0].IT_CURRENTLY_USE_TXT.value == '')
		{
			alert("Please check the vendor's storage products/services do you currently use - other.");
			myFocus=document.getElementById("IT_CURRENTLY_USE");
			myFocus.scrollIntoView(true);
			document.forms[0].IT_CURRENTLY_USE_TXT.focus();
			return false;
		}
	}
   }
//question 9
        if (ObjectExists(document.forms[0],"IT_CONSIDERING-01"))
	{
	if (!CheckboxChecked(document.forms[0],'IT_CONSIDERING'))
	{
		alert ("Please check the storage vendors are currently considering.");
		myFocus=document.getElementById("IT_CONSIDERING");
		myFocus.scrollIntoView(true);
		return false;
		
	}
	if (document.getElementById('IT_CONSIDERING98').checked)
	{
		if (document.forms[0].IT_CONSIDERING_TXT.value == '')
		{
			alert ("Please check the storage vendors are currently considering - other.");
			myFocus=document.getElementById("IT_CONSIDERING");
			myFocus.scrollIntoView(true);
			document.forms[0].IT_CONSIDERING_TXT.focus();
			return false;
		}
	
	}
   }
//question 10
        if (ObjectExists(document.forms[0],"IT_APPLICATIONS-01"))
	{
	if (!CheckboxChecked(document.forms[0],'IT_APPLICATIONS'))
	{
		alert ("Please check the applications.");
		myFocus=document.getElementById("IT_APPLICATIONS");
		myFocus.scrollIntoView(true);
		return false;
	}
	if (document.getElementById('IT_APPLICATIONS98').checked)
	{
		if (document.forms[0].IT_APPLICATIONS_TXT.value == '')
		{
			alert ("Please check the applications - other.");
			myFocus=document.getElementById("IT_APPLICATIONS");
			myFocus.scrollIntoView(true);
			document.forms[0].IT_APPLICATIONS_TXT.focus();
			return false;
		}
	}
   }


	return true;
} 		
function DemoBlockVEND(mode)
{
    if (mode != "ADD")
	{
    		if (!CheckUnselects(document.forms[0].RECEIVE_YES_NO))
    		{
    			alert("Please specify whether you wish to receive Storage Magazine.");
            		document.forms[0].RECEIVE_YES_NO[0].focus();
    			return false;
    		}


    		//if (document.forms[0].RECEIVE_YES_NO[1].checked)
    		// stop validation when "not to receive" response
    		//{
    		//	return true;
    		//}
    		if (!CheckUnselects(document.forms[0].IT_MANAGE))
    		{
    			alert("Please specify if you manage, evaluate or recommend storage software or services?");
    			document.forms[0].IT_MANAGE[0].focus();
    			return false;
    		}
    }

//question 1
if (ObjectExists(document.forms[0],"VENDOR_COMPANY-01"))
	{
	if (!CheckboxChecked(document.forms[0],'VENDOR_COMPANY'))
	{
		alert ("Please check which of the following best describes your company.");
		myFocus=document.getElementById("VENDOR_COMPANY");
		myFocus.scrollIntoView(true);
		return false;
	}
if (document.getElementById('VENDOR_COMPANY98').checked)
	{
	    if (document.forms[0].VENDOR_COMPANY_TXT.value == '')
 	     { alert("Please check which of the following best describes your company - other.");
       	       myFocus=document.getElementById("VENDOR_COMPANY");
	       myFocus.scrollIntoView(true); 
	       document.forms[0].VENDOR_COMPANY_TXT.focus();
	       return false;
             }
	
	}
}
	
//question 2
if (ObjectExists(document.forms[0],"VENDOR_JOB_FUNCTION"))
{
	if (!checkDropdown(document.forms[0].VENDOR_JOB_FUNCTION))
		{
		alert ("Please select a category that best describes your job function.");
		document.forms[0].VENDOR_JOB_FUNCTION.focus();
		return false;
		}

//if //((document.forms[0].VENDOR_JOB_FUNCTION[document.forms[0].VENDOR_JOB_FUNCTION.selectedIndex].valu//e == '98')&& (document.forms[0].VENDOR_JOB_FUNCTION_DESC.value == ''))
		//{
		//alert ("Please specify your job function description.");
		//document.forms[0].VENDOR_JOB_FUNCTION_DESC.focus();
		//return false;
		//}

}
//question 3
if (ObjectExists(document.forms[0],"VENDOR_STORAGE-01"))
	{

	if (!CheckboxChecked(document.forms[0],'VENDOR_STORAGE'))
		
          {
		alert ("Please check the area of storage that best reflects what your company specializes in.");
		myFocus=document.getElementById("VENDOR_STORAGE");
		myFocus.scrollIntoView(true);
		return false;
	}

if (document.getElementById('VENDOR_STORAGE98').checked)
	{
	    if (document.forms[0].VENDOR_STORAGE_TXT.value == '')
 	     { alert("Please check the area of storage - other.");
       	       myFocus=document.getElementById("VENDOR_STORAGE");
	       myFocus.scrollIntoView(true);
               document.forms[0].VENDOR_STORAGE_TXT.focus();
	       return false;
             }
	
	}
}

// question 4
	if (ObjectExists(document.forms[0],"VENDOR_EMPLOYEES"))
	{
		if (!checkDropdown(document.forms[0].VENDOR_EMPLOYEES))
		{
		alert ("Please select the total number of empyees at your company.");
		document.forms[0].VENDOR_EMPLOYEES.focus();
		return false;
		}	
	}
// question 5
	if (ObjectExists(document.forms[0],"VENDOR_REVENUE"))
	{
		if (!checkDropdown(document.forms[0].VENDOR_REVENUE))
		{
		alert ("Please select the total esimated annual storage related revenue.");
		document.forms[0].VENDOR_REVENUE.focus();
		return false;
	}	}		
//question 6	
	if (ObjectExists(document.forms[0],"VENDOR_SALES_MODEL-01"))
	{
		if (!CheckboxChecked(document.forms[0],'VENDOR_SALES_MODEL'))
		{
		alert ("Please check your company's primary sales model.");
		myFocus=document.getElementById("VENDOR_SALES_MODEL");
		myFocus.scrollIntoView(true);
		return false;
		}


	if (document.getElementById('VENDOR_SALES_MODEL98').checked)
		{
	    	if (document.forms[0].VENDOR_SLS_MODEL_TXT.value == '')
 	     		{ 
				alert("Please check the area of storage - other.");
       	      	 		myFocus=document.getElementById("VENDOR_SALES_MODEL");
	      	 		myFocus.scrollIntoView(true);
               			document.forms[0].VENDOR_SLS_MODEL_TXT.focus();
	       			return false;
             		}
	
		}
}
//question 7
if (ObjectExists(document.forms[0],"VENDOR_BUDGET"))
	{
	if (!checkDropdown(document.forms[0].VENDOR_BUDGET))
	{
		alert ("Please select your organization's annual marketing budget for storage products.");
		document.forms[0].VENDOR_BUDGET.focus();
		return false;
	}	
}	
//question 8

	if (!CheckboxChecked(document.forms[0],'VENDOR_CONFERENCES'))
		
        {
		alert ("Please check if your company advertise on conferences.");
		myFocus=document.getElementById("VENDOR_CONFERENCES");
		myFocus.scrollIntoView(true);
		return false;
	}
if (document.getElementById('VENDOR_CONFERENCES98').checked)
	{
	    if (document.forms[0].VENDOR_CONF_TXT.value == '')
 	     { alert("Please check if your company advertise on conferences - other.");
       	       myFocus=document.getElementById("VENDOR_CONFERENCES");
	       myFocus.scrollIntoView(true);
               document.forms[0].VENDOR_CONF_TXT.focus();
	       return false;
             }
	
	}
	if (!CheckboxChecked(document.forms[0],'VENDOR_PRINT'))
		
	{
		alert ("Please check if your company advertise in print.");
		myFocus=document.getElementById("VENDOR_PRINT");
		myFocus.scrollIntoView(true);
		return false;
	}
if (document.getElementById('VENDOR_PRINT98').checked)
	{
	    if (document.forms[0].VENDOR_PRINT_TXT.value == '')
 	     { alert("Please check if your company advertise in print - other.");
       	       myFocus=document.getElementById("VENDOR_PRINT");
	       myFocus.scrollIntoView(true);
	       document.forms[0].VENDOR_PRINT_TXT.focus();
	       return false;
             }
	
	}
	if (!CheckboxChecked(document.forms[0],'VENDOR_ONLINE'))
	{
		alert ("Please check if your company advertise online.");
		myFocus=document.getElementById("VENDOR_ONLINE");
		myFocus.scrollIntoView(true);
		return false;
	}
if (document.getElementById('VENDOR_ONLINE98').checked)
	{
	    if (document.forms[0].VENDOR_ONLINE_TXT.value == '')
 	     { alert("Please check if your company advertise online - other.");
       	       myFocus=document.getElementById("VENDOR_ONLINE");
	       myFocus.scrollIntoView(true);
               document.forms[0].VENDOR_ONLINE_TXT.focus();
	       return false;
             }
	
	}

     
	return true;
} 		
function CheckboxChecked(thisform,CheckBoxName)
{
var ChLength = CheckBoxName.length + 1;
var vName = CheckBoxName + "-";

var CBindex = 0;
	for ( i=0; i < thisform.elements.length; i++)
	{
		if (thisform.elements[i].type == "checkbox")
		{
			if (thisform.elements[i].name.substring(0,ChLength)==vName)
			{
				if (CBindex==0) {CBindex = i;}
				if (thisform.elements[i].checked)
				{
					return true;
					break;
				}
			}
		}

	}
	thisform.elements[CBindex].focus();
	return false;
}
// declare global variables
var i;
var IT_SPECIFY;
var VENDOR_CONFERENCES;
var VENDOR_PRINT;
var VENDOR_ONLINE;
var SubmitFlag;
var formindex;

// on load calculate indices for all group of checkboxes with 'None of the Above' option 
function InitIndex(formname)
{
	// get form index
	for (i=0; i<document.forms.length; i++)
	{
		if (document.forms[i].name == formname)
		{
			break;
		}
	}
	formindex = i;

	SubmitFlag = false;
	//for ( i=0; i < document.forms[formindex].elements.length; i++)
	i = 0;
	{
		
		GetIndex(formindex, "IT_SPECIFY");
		IT_SPECIFY = i;
		i++;
		GetIndex(formindex, "VENDOR_CONFERENCES");
		VENDOR_CONFERENCES = i;
		i++;
		GetIndex(formindex, "VENDOR_PRINT");
		VENDOR_PRINT = i;
		i++;
		GetIndex(formindex, "VENDOR_ONLINE");
		VENDOR_ONLINE = i;
		i++;

	//	break;
	}
}
function GetIndex(formindex, GroupName)
{
	var namelen = GroupName.length;

	while ((document.forms[formindex].elements[i].name.substring(0,namelen) != GroupName) && (i < document.forms[formindex].elements.length-1))
	{
		i++;
	}
	if (document.forms[formindex].elements[i].name.substring(0,namelen) != GroupName)
	{
		i=0;	// if control not found reset counter
	}
}
// This function is running with assumption that 'None of the Above' option is the very last
// in the group of checkboxes.
// Start index must be calculated when document is being loaded using InitIndex() function 

function checker(start,groupname,none)
			// start - start index for group of checkboxes
			// generic name of group of checkboxes (Example: "QUES_5")
			// 'None of the above' option (Example: "99" if "QUES_5-99" is 
			//			a name of 'None of the above' checkbox
{
	var namelen = groupname.length;
	var OptionChecked = false;
	var LoopCount = parseInt(none);
	var NoneName = groupname + "-" + none;
	
	
	for ( var j=start; j < document.forms[formindex].elements.length; j++)
	{
		if (document.forms[formindex].elements[j].name.substring(0,namelen) == groupname)
		{	// group of check boxes located: continue loop inside the group
			while (LoopCount>=0)
			{ 
				if (document.forms[formindex].elements[j].name == NoneName)
 				{
 					if (OptionChecked == true)
 					{
 						document.forms[formindex].elements[j].checked = false;
 					}
 					LoopCount=0;	//break the loop when reach None option
 				}
 				else
 				{
					if (OptionChecked != true)
					{
 						if (document.forms[formindex].elements[j].checked==true)
 						{
 							OptionChecked = true;
 						}
					}
 				}
				j++;
				LoopCount--;
			}
			break;
		}
	}
}
function AnswerCheck(form)
{ 
var MyFocus;
//question 1

if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		} 
if(document.forms[0].RECEIVE_YES_NO[1].checked == true)
	// stop validation when "not to receive" response
	{
		return true;
	}      
    
//question 2


	if (!CheckUnselects(document.forms[0].IT_MANAGE))
		{
		alert("Please specify if you manage, evaluate or recommend storage software or services?");
			document.forms[0].IT_MANAGE[0].focus();
			return false;
		}

//question 3
	if (ObjectExists(document.forms[0],"IT_ROLE"))
	{
               	if (!CheckUnselects(document.forms[0].IT_ROLE))
		{
			alert("Please specify your role.");
			document.forms[0].IT_ROLE[0].focus();
			return false;
		}
	}

// question 3
	
	if (!checkDropdown(document.forms[0].IT_EMPL_COMPANY))
		{
		alert ("Please select the total number of employees at your company.");
		document.forms[0].IT_EMPL_COMPANY.focus();
		return false;
		}	

//question 4

	if (!CheckboxChecked(document.forms[0],'IT_SPECIFY'))
	{
		alert ("Please check your role in purchasing.");
		myFocus=document.getElementById("IT_SPECIFY");
		myFocus.scrollIntoView(true);
		return false;
	}

// question 5
	
	if (!checkDropdown(document.forms[0].IT_TERABYTES_LOCATION))
		{
		alert ("Please select the total terabytes of storage installed at your location.");
		document.forms[0].IT_TERABYTES_LOCATION.focus();
		return false;
		}	
// question 6
	
	if (!checkDropdown(document.forms[0].IT_ANNUAL_EXPENDITURE))
		{
		alert ("Please select your average annual expenditure on storage.");
		document.forms[0].IT_ANNUAL_EXPENDITURE.focus();
		return false;
		}	

//question 7
	if (ObjectExists(document.forms[0],"IT_OPERATING_SYSTEMS"))
	{

		if (!CheckboxChecked(document.forms[0],'IT_OPERATING_SYSTEMS'))
		{
			alert ("Please specify your IT operating systems.");
			myFocus=document.getElementById("IT_OPERATING_SYSTEMS");
			myFocus.scrollIntoView(true);
			return false;
		}	
		if (document.getElementById('IT_OPERATING_SYSTEMS98').checked)
		{
			if (document.forms[0].IT_OP_SYS_TXT.value == '')
 	   		{ 
				alert("Please specify your IT operating systems - other.");
       	     			myFocus=document.getElementById("IT_OPERATING_SYSTEMS");
	     			myFocus.scrollIntoView(true); 
	     			document.forms[0].IT_OP_SYS_TXT.focus();
	     			return false;
			}
		}
	}



//question 8

	if (!CheckUnselects(document.forms[0].IT_INDUSTRY))
		{
		alert("Please select categories that best reflects your organization's industry.");
			document.forms[0].IT_INDUSTRY[0].focus();
			return false;
		}

	//if (CheckedRadioValue(document.forms[0].IT_INDUSTRY)=="98")
			//{
		//		if(document.forms[0].IT_INDUSTRY_DESC.value == "")
				//{
				//	alert("Please specify your organization's industry //description.");
	        	//		document.forms[0].IT_INDUSTRY_DESC.focus();
			//		return false;
			//	}
			//}

//question 9
	if (ObjectExists(document.forms[0],"IT_CURRENTLY_USE-01"))
	{
	
		if (!CheckboxChecked(document.forms[0],'IT_CURRENTLY_USE'))
		{
			alert ("Please check the vendor's storage products/services do you currently use.");
			myFocus=document.getElementById("IT_CURRENTLY_USE");
			myFocus.scrollIntoView(true);
			return false;
		}

		if (document.getElementById('IT_CURRENTLY_USE98').checked)
		{
	    		if (document.forms[0].IT_CURRENTLY_USE_TXT.value == '')
 	     		{ 
				alert("Please check the vendor's storage products/services do you currently use - other.");
				myFocus=document.getElementById("IT_CURRENTLY_USE");
				myFocus.scrollIntoView(true);
				document.forms[0].IT_CURRENTLY_USE_TXT.focus();
				return false;
			}
		}
	}

//question 10

	if (ObjectExists(document.forms[0],"IT_PRODUCTS_CONSIDER"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_PRODUCTS_CONSIDER'))
		{
			alert ("Please specify your IT products consider.");
			myFocus=document.getElementById("IT_PRODUCTS_CONSIDER");
			myFocus.scrollIntoView(true);
			return false;
		}
		if (document.getElementById('IT_PRODUCTS_CONSIDER98').checked)
		{
			if (document.forms[0].IT_PROD_CONSIDER_TXT.value == '')
			{ 
				alert("Please specify your IT products consider - other.");
				myFocus=document.getElementById("IT_PRODUCTS_CONSIDER");
				myFocus.scrollIntoView(true);
				document.forms[0].IT_PROD_CONSIDER_TXT.focus();
				return false;
			}
		}
	}

//question 11
	if (ObjectExists(document.forms[0],"IT_CONSIDERING-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_CONSIDERING'))
		{
			alert ("Please check the storage vendors are currently considering.");
			myFocus=document.getElementById("IT_CONSIDERING");
			myFocus.scrollIntoView(true);
			return false;
		
		}
		if (document.getElementById('IT_CONSIDERING98').checked)
		{
			if (document.forms[0].IT_CONSIDERING_TXT.value == '')
 			{ 
				alert("Please check the storage vendors are currently considering - other.");
				myFocus=document.getElementById("IT_CONSIDERING");
				myFocus.scrollIntoView(true);
				document.forms[0].IT_CONSIDERING_TXT.focus();
				return false;
			}
		}
	}
//question 12
	if (ObjectExists(document.forms[0],"IT_APPLICATIONS-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_APPLICATIONS'))
		{
			alert ("Please check the applications.");
			myFocus=document.getElementById("IT_APPLICATIONS");
			myFocus.scrollIntoView(true);
			return false;
		}
		if (document.getElementById('IT_APPLICATIONS98').checked)

		{
			if (document.forms[0].IT_APPLICATIONS_TXT.value == '')
			{ 
				alert("Please check the applications - other.");
       	       			myFocus=document.getElementById("IT_APPLICATIONS");
				myFocus.scrollIntoView(true);
				document.forms[0].IT_APPLICATIONS_TXT.focus();
				return false;
			}
		}
	}

		
	return true;
} 		
function AnswerCheckShort(form)
{ 
var MyFocus;
//question 1

if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		} 
if(document.forms[0].RECEIVE_YES_NO[1].checked == true)
	// stop validation when "not to receive" response
	{
		return true;
	}
// email address
if (ObjectExists(document.forms[0],"EMAIL_ADDRESS"))
{  
if ((document.forms[0].EMAIL_ADDRESS.value != "") && (!validEmail(document.forms[0].EMAIL_ADDRESS.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}  
}  
      if(!CheckUnselects(document.forms[0].REQUESTED_VERSION))	
	{
		alert("Please specify if you like to receive your subscription in a digital format.");
        	document.forms[0].REQUESTED_VERSION[0].focus();
		return false;
	}
		
//question 18 - Personal ID
	if (!checkDropdown(document.forms[0].PERSONAL_ID))
		{
			alert("Please select the first letter of the city you were born in.")
			document.forms[0].PERSONAL_ID.focus();
			return false;
		}


	return true;
} 
function AnswerCheckAdd(form)
{ 
var MyFocus;

		if(document.forms[0].FNAME.value == "")
		{
			alert("Please specify your First name.");
        		document.forms[0].FNAME.focus();
			return false;
		}
		if(document.forms[0].LNAME.value == "")
		{
			alert("Please specify your Last name.");
        		document.forms[0].LNAME.focus();
			return false; 
		}

		if(document.forms[0].TITLE.value == "")
		{
			alert("Please specify your Title.");
	        document.forms[0].TITLE.focus();
			return false;
		}
		if(document.forms[0].COMPANY.value == "")
		{
			alert("Please specify your company.");
	        	document.forms[0].COMPANY.focus();
			return false;
		}
		
				
		if(document.forms[0].ADDRESS2.value == "")
		{
			alert("Please specify your Street Address.");
	        	document.forms[0].ADDRESS2.focus();
			return false;
		}
		if(document.forms[0].CITY.value == "")
		{
			alert("Please specify your City.");
	        	document.forms[0].CITY.focus();
			return false;
		}
		if (document.forms[0].STATE.selectedIndex == 0)
		{
			alert("Please specify your State/Province or select 'I am not in the US or Canada'.");
		        document.forms[0].STATE.focus();
			return false;
		}

		// validate Canadian state/postal code combination
		if (!ValidCanPostal(document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value,document.forms[0].ZIPCODE.value))
		{
			alert ("Invalid Canadian province/postal code combination.");
        		document.forms[0].STATE.focus();
			return false;
		}

		if (document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value == "53")
		{
			if (document.forms[0].COUNTRY.value == "")
			{
				alert("Please specify your Country.");
	        		document.forms[0].COUNTRY.focus();
				return false;
			}
		}
		else
		{
			if (document.forms[0].ZIPCODE.value.length < 5)
			{
				alert("Please specify your Zip/Postal Code.");
	        		document.forms[0].ZIPCODE.focus();
				return false;
			}
		}
	
	if (document.forms[0].PHONE.value == "") 
	{
		alert("Please specify your phone.");
		document.forms[0].PHONE.focus();
		return false;
	}
        if(document.forms[0].EMAIL_ADDRESS.value == "")
	{
		alert("Please specify your Email Address.");
	        document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}

	if ((document.forms[0].EMAIL_ADDRESS.value != "") && (!validEmail(document.forms[0].EMAIL_ADDRESS.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}

//question 1

	if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		} 
	if(document.forms[0].RECEIVE_YES_NO[1].checked == true)
	// stop validation when "not to receive" response
	{
		return true;
	}      
    
//question 2


	if (!CheckUnselects(document.forms[0].IT_MANAGE))
		{
		alert("Please specify if you manage, evaluate or recommend storage software or services?");
			document.forms[0].IT_MANAGE[0].focus();
			return false;
		}

//question 3
	if (ObjectExists(document.forms[0],"IT_ROLE"))
	{
		if (!CheckUnselects(document.forms[0].IT_ROLE))
		{
			alert("Please specify your role.");
			document.forms[0].IT_ROLE[0].focus();
			return false;
		}
	}

// question 4
	
	if (!checkDropdown(document.forms[0].IT_EMPL_COMPANY))
		{
		alert ("Please select the total number of employees at your company.");
		document.forms[0].IT_EMPL_COMPANY.focus();
		return false;
		}	


// question 5
	
	if (!checkDropdown(document.forms[0].IT_TERABYTES_LOCATION))
		{
		alert ("Please select the total terabytes of storage installed at your location.");
		document.forms[0].IT_TERABYTES_LOCATION.focus();
		return false;
		}	
// question 6
	
	if (!checkDropdown(document.forms[0].IT_ANNUAL_EXPENDITURE))
		{
		alert ("Please select your average annual expenditure on storage.");
		document.forms[0].IT_ANNUAL_EXPENDITURE.focus();
		return false;
		}	

//question 7

	if (!checkDropdown(document.forms[0].IT_INDUSTRY))
		{
		alert ("Please select categories that best reflects your organization's industry.");
		document.forms[0].IT_INDUSTRY.focus();
		return false;
		}

//if ((document.forms[0].IT_INDUSTRY[document.forms[0].IT_INDUSTRY.selectedIndex].value == '98')&& //(document.forms[0].IT_INDUSTRY_DESC.value == ''))
		//{
		//alert ("Please specify your organization's industry description.");
		//document.forms[0].IT_INDUSTRY_DESC.focus();
		//return false;
		//}
//question 8

	if (!CheckboxChecked(document.forms[0],'IT_SPECIFY'))
	{
		alert ("Please check your role in purchasing.");
		return false;
	}


//question 9
	if (ObjectExists(document.forms[0],"IT_OPERATING_SYSTEMS-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_OPERATING_SYSTEMS'))
		{
			alert ("Please specify your IT operating systems.");
			myFocus=document.getElementById("IT_OPERATING_SYSTEMS");
			myFocus.scrollIntoView(true);
			return false;
		}	
		if (document.getElementById('IT_OPERATING_SYSTEMS98').checked)
		{
			if (document.forms[0].IT_OP_SYS_TXT.value == '')
 			{ 
				alert("Please specify your IT operating systems - other.");
				myFocus=document.getElementById("IT_OPERATING_SYSTEMS");
				myFocus.scrollIntoView(true); 
				document.forms[0].IT_OP_SYS_TXT.focus();
				return false;
			}
		}
	}

//question 10

	if (ObjectExists(document.forms[0],"IT_PRODUCTS_CONSIDER-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_PRODUCTS_CONSIDER'))
		{
			alert ("Please specify your IT products consider.");
			myFocus=document.getElementById("IT_PRODUCTS_CONSIDER");
			myFocus.scrollIntoView(true);
			return false;
		}
		if (document.getElementById('IT_PRODUCTS_CONSIDER98').checked)
		{
			if (document.forms[0].IT_PROD_CONSIDER_TXT.value == '')
			{ 
				alert("Please specify your IT products consider - other.");
				myFocus=document.getElementById("IT_PRODUCTS_CONSIDER");
				myFocus.scrollIntoView(true);
 				document.forms[0].IT_PROD_CONSIDER_TXT.focus();
				return false;
			}
		}
	}

//question 11
	if (ObjectExists(document.forms[0],"IT_CURRENTLY_USE-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_CURRENTLY_USE'))
		{
			alert ("Please check the vendor's storage products/services do you currently use.");
			myFocus=document.getElementById("IT_CURRENTLY_USE");
			myFocus.scrollIntoView(true);
			return false;
		}

		if (document.getElementById('IT_CURRENTLY_USE98').checked)
		{
			if (document.forms[0].IT_CURRENTLY_USE_TXT.value == '')
			{ 
				alert("Please check the vendor's storage products/services do you currently use - other.");
				myFocus=document.getElementById("IT_CURRENTLY_USE");
				myFocus.scrollIntoView(true);
				document.forms[0].IT_CURRENTLY_USE_TXT.focus();
				return false;
			}
		}
	}
//question 12
	if (ObjectExists(document.forms[0],"IT_CONSIDERING-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_CONSIDERING'))
		{
			alert ("Please check the storage vendors are currently considering.");
			myFocus=document.getElementById("IT_CONSIDERING");
			myFocus.scrollIntoView(true);
			return false;
		}
		if (document.getElementById('IT_CONSIDERING98').checked)
		{
			if (document.forms[0].IT_CONSIDERING_TXT.value == '')
			{ 
				alert("Please check the storage vendors are currently considering - other.");
				myFocus=document.getElementById("IT_CONSIDERING");
				myFocus.scrollIntoView(true);
				document.forms[0].IT_CONSIDERING_TXT.focus();
				return false;
			}
		}
	}
//question 13
	if (ObjectExists(document.forms[0],"IT_APPLICATIONS-01"))
	{
		if (!CheckboxChecked(document.forms[0],'IT_APPLICATIONS'))
		{
			alert ("Please check the applications.");
			myFocus=document.getElementById("IT_APPLICATIONS");
			myFocus.scrollIntoView(true);
			return false;
		}
		if (document.getElementById('IT_APPLICATIONS98').checked)
		{
			if (document.forms[0].IT_APPLICATIONS_TXT.value == '')
			{ 
				alert("Please check the applications - other.");
				myFocus=document.getElementById("IT_APPLICATIONS");
				myFocus.scrollIntoView(true);
				document.forms[0].IT_APPLICATIONS_TXT.focus();
				return false;
			}
		}
	}
	return true;
} 
function PaidformCheck(mode, description)
{ 
	if(!CheckUnselects(document.paidform.SUBSCRIPTION))	
	{
		alert("Please select your subscription.");
        	document.paidform.SUBSCRIPTION[0].focus();
		return false;
	}
	if(document.paidform.FNAME.value == "")
	{
		alert("Please specify your First name.");
       		document.paidform.FNAME.focus();
		return false;
	}
	if(document.paidform.LNAME.value == "")
        {
		alert("Please specify your Last name.");
        	document.paidform.LNAME.focus();
		return false;
	}

	if(document.paidform.ADDRESS2.value == "")
	{
		alert("Please specify your Street Address.");
        	document.paidform.ADDRESS2.focus();
		return false;
	}
	if(document.paidform.CITY.value == "")
	{
		alert("Please specify your City.");
        	document.paidform.CITY.focus();
		return false;
	}
	if (document.paidform.STATE.selectedIndex == 0)
	{
		alert("Please specify your State/Province or select 'I am not in the U.S. or Canada'.");
	        document.paidform.STATE.focus();
		return false;
	}
	// validate Canadian state/postal code combination
	if (!ValidCanPostal(document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value,document.forms[0].ZIPCODE.value))
	{
		alert ("Invalid Canadian province/postal code combination.");
        	document.forms[0].STATE.focus();
		return false;
	}

	if (document.forms[0].STATE[document.forms[0].STATE.selectedIndex].value == "53")
	{
		if (document.forms[0].COUNTRY.value == "")
		{
			alert("Please specify your Country.");
	        	document.forms[0].COUNTRY.focus();
			return false;
		}
	}
	else
	{
		if (document.forms[0].ZIPCODE.value.length < 5)
		{
			alert("Please specify your Zip/Postal Code.");
	        	document.forms[0].ZIPCODE.focus();
			return false;
		}
	}
	if ((document.paidform.EMAIL_ADDRESS.value != "") && (!validEmail(document.paidform.EMAIL_ADDRESS.value)))
	{
	       alert("You have entered an invalid email address. Please re-enter it.");
		document.paidform.EMAIL_ADDRESS.focus();
		return false;
	}
		if(!checkDropdown(document.paidform.CARD_TYPE))
	{
		alert("Please specify credit card.");
        	document.paidform.CARD_TYPE.focus();
		return false;
	}

	if(document.paidform.CARD_NUMBER.value == "")
	{
		alert("Please specify credit card number.");
        	document.paidform.CARD_NUMBER.focus();
		return false;
	}

	if(checkDropdown(document.paidform.CARD_TYPE))
	{
		// Visa
		if(document.paidform.CARD_TYPE.selectedIndex==1)
		{
			if (!isVisa(stripWhitespace(document.paidform.CARD_NUMBER.value)))
			{
				alert("Invalid credit card number. Please re-enter.")
        			document.paidform.CARD_NUMBER.focus();
				return false;
			}
		}

		// MasterCard
		if(document.paidform.CARD_TYPE.selectedIndex==2)
		{
			if (!isMasterCard(stripWhitespace(document.paidform.CARD_NUMBER.value)))
			{
				alert("Invalid credit card number. Please re-enter.")
        			document.paidform.CARD_NUMBER.focus();
				return false;
			}
		}

		// AmEx
		if(document.paidform.CARD_TYPE.selectedIndex==3)
		{
			if (!isAmericanExpress(stripWhitespace(document.paidform.CARD_NUMBER.value)))
			{
				alert("Invalid credit card number. Please re-enter.")
        			document.paidform.CARD_NUMBER.focus();
				return false;
			}
		}
	}
	
	if(!checkDropdown(document.paidform.ExpMon))
	{
 		alert('Please select the expiration month.');
		document.paidform.ExpMon.focus();
 		return false;
	}

	if(!checkDropdown(document.paidform.ExpYear))
	{
 		alert('Please select the expiration year.');
		document.paidform.ExpYear.focus();
 		return false;
	}
      if(document.paidform.SCODE.value == "")
	{
		alert('Please enter security code.');
		document.paidform.SCODE.focus();
		return false;
	}

     
 }  		
function ObjectExists(form,fieldname)
{
	for ( i=0; i < form.elements.length; i++)
	{
		if (form.elements[i].name == fieldname)
		{
			return true;
		}
	}
	return false;
}
function AnswerCheckAbbr(form)
{ 
var MyFocus;
//question 1

if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		} 
if(document.forms[0].RECEIVE_YES_NO[1].checked == true)
	// stop validation when "not to receive" response
	{
		return true;
	}
// email address
if (ObjectExists(document.forms[0],"EMAIL_ADDRESS"))
{  
if ((document.forms[0].EMAIL_ADDRESS.value != "") && (!validEmail(document.forms[0].EMAIL_ADDRESS.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}  
} 

//question 2

	if (!CheckboxChecked(document.forms[0],'IT_SPECIFY'))
	{
		alert ("Please check your role in purchasing.");
		return false;
	}
//question 3
      if(!CheckUnselects(document.forms[0].REQUESTED_VERSION))	
	{
		alert("Please specify if you like to receive your subscription in a digital format.");
        	document.forms[0].REQUESTED_VERSION[0].focus();
		return false;
	}
		
//question 4
	if (!checkDropdown(document.forms[0].PERSONAL_ID))
		{
			alert("Please select the first letter of the city you were born in.")
			document.forms[0].PERSONAL_ID.focus();
			return false;
		}


	return true;
} 
function AnswerCheckSpec(form)
{ 
var MyFocus;
//question 1

if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		} 
if(document.forms[0].RECEIVE_YES_NO[1].checked == true)
	// stop validation when "not to receive" response
	{
		return true;
	}
// email address
if (ObjectExists(document.forms[0],"EMAIL_ADDRESS"))
{  
if ((document.forms[0].EMAIL_ADDRESS.value != "") && (!validEmail(document.forms[0].EMAIL_ADDRESS.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}  
} 

//question 2

	if (!CheckboxChecked(document.forms[0],'IT_SPECIFY'))
	{
		alert ("Please check your role in purchasing.");
		return false;
	}
// question 3
	
	if (!checkDropdown(document.forms[0].IT_ANNUAL_EXPENDITURE))
		{
		alert ("Please select your average annual expenditure on storage.");
		document.forms[0].IT_ANNUAL_EXPENDITURE.focus();
		return false;
		}	
//question 4
      if(!CheckUnselects(document.forms[0].REQUESTED_VERSION))	
	{
		alert("Please specify if you like to receive your subscription in a digital format.");
        	document.forms[0].REQUESTED_VERSION[0].focus();
		return false;
	}		
//question 5
	if (!checkDropdown(document.forms[0].PERSONAL_ID))
		{
			alert("Please select the first letter of the city you were born in.")
			document.forms[0].PERSONAL_ID.focus();
			return false;
		}


	return true;
} 
function AnswerCheckExp(form)
{ 
var MyFocus;
//question 1

if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		} 
if(document.forms[0].RECEIVE_YES_NO[1].checked == true)
	// stop validation when "not to receive" response
	{
		return true;
	}
// email address
if (ObjectExists(document.forms[0],"EMAIL_ADDRESS"))
{  
if ((document.forms[0].EMAIL_ADDRESS.value != "") && (!validEmail(document.forms[0].EMAIL_ADDRESS.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}  
} 


// question 2
	
	if (!checkDropdown(document.forms[0].IT_ANNUAL_EXPENDITURE))
		{
		alert ("Please select your average annual expenditure on storage.");
		document.forms[0].IT_ANNUAL_EXPENDITURE.focus();
		return false;
		}	
//question 3
      if(!CheckUnselects(document.forms[0].REQUESTED_VERSION))	
	{
		alert("Please specify if you like to receive your subscription in a digital format.");
        	document.forms[0].REQUESTED_VERSION[0].focus();
		return false;
	}		
//question 4
	if (!checkDropdown(document.forms[0].PERSONAL_ID))
		{
			alert("Please select the first letter of the city you were born in.")
			document.forms[0].PERSONAL_ID.focus();
			return false;
		}


	return true;
} 		
		
function AnswerCheckBudget(form)
{ 
var MyFocus;
//question 1

if(document.forms[0].RECEIVE_YES_NO[0].checked == false && document.forms[0].RECEIVE_YES_NO[1].checked == false)
		{
			alert("Please specify whether you wish to receive Storage Magazine.");
        		document.forms[0].RECEIVE_YES_NO[0].focus();
			return false;
		} 
if(document.forms[0].RECEIVE_YES_NO[1].checked == true)
	// stop validation when "not to receive" response
	{
		return true;
	}
// email address
if (ObjectExists(document.forms[0],"EMAIL_ADDRESS"))
{  
if ((document.forms[0].EMAIL_ADDRESS.value != "") && (!validEmail(document.forms[0].EMAIL_ADDRESS.value)))
	{
		alert("You have entered an invalid email address. Please re-enter it.");
		document.forms[0].EMAIL_ADDRESS.focus();
		return false;
	}  
} 

//question 2

	if (!CheckboxChecked(document.forms[0],'IT_SPECIFY'))
	{
		alert ("Please check your role in purchasing.");
		return false;
	}
// question 3
	
	if (!checkDropdown(document.forms[0].IT_ANNUAL_EXPENDITURE))
		{
		alert ("Please select your average annual expenditure on storage.");
		document.forms[0].IT_ANNUAL_EXPENDITURE.focus();
		return false;
		}	
		
// question 4
	
	if (!checkDropdown(document.forms[0].IT_TERABYTES_MANAGE))
		{
		alert ("Please select the number of terabytes of storage you manage.");
		document.forms[0].IT_TERABYTES_MANAGE.focus();
		return false;
		}	
//question 5
      if(!CheckUnselects(document.forms[0].REQUESTED_VERSION))	
	{
		alert("Please specify if you like to receive your subscription in a digital format.");
        	document.forms[0].REQUESTED_VERSION[0].focus();
		return false;
	}		
//question 6
	if (!checkDropdown(document.forms[0].PERSONAL_ID))
		{
			alert("Please select the first letter of the city you were born in.")
			document.forms[0].PERSONAL_ID.focus();
			return false;
		}


	return true;
} 						