function checkZipcode( theForm ) {


	if ( theForm.zipcode != "" && theForm.zipcode.value.length < 5 ) {
		alert( "The zip code entered is not valid. Please enter a valid zip code" );
		return false;
	}
	return true;
}


function closeEmailWindow() {

   //window.close();
	
   parent.dismissbox();
        	
	return false;
}

function checkParams( domain, theForm ) {

	if ( !checkEmail( theForm.email.value ) ) {
		alert( "The email address entered is not valid. Please enter a valid email address." );
		return false;
	}

	var winT = (screen.height - 400)/2;
	var winL = (screen.width - 500)/2;

	//Use below code to load DHTML Window as page loads 
	EmailOptIn( domain + "/webapp/wcs/stores/servlet/AddEmailToAuxList?storeId=10001&catalogId=10001&langId=-1&url=AuxEmailRegisterView&email=" + theForm.email.value,420,300 );

	return false;
}

function checkEmail( email_address ) {

     var specialchars = ' !#%^&*()=|\/<>?`,:;';
     var status=true;
     atPos = email_address.indexOf('@');
     ldotPos = email_address.lastIndexOf('.');

     if ( email_address == '' )
	  	return false;

     //  if no @, if @ is first char, atleast 4 chars after the @, no multiple @ signs allowed
     if ( (atPos == -1) || ((atPos+1) < 2) ||  ( (atPos+1) > (email_address.length - 4) ) )
     	return false;

        // . is the first char, no more than one @ in the field, atleast 2 chars after the last  .
	  if( email_address.indexOf('.',0) == 0 || (ldotPos+1) > (email_address.length - 2) )
		return false;

	//check for consecutive dots
	dotPos1 = 0;
	for(i=0; (i < email_address.length) && status == true; i++)
	{
	  dotPos1 = email_address.indexOf('.', i)
	  if( email_address.charAt(dotPos1 + 1) == '.' )
			return false;
	}

   if( (email_address.indexOf('@', atPos + 1) != -1 ) && status == true  )
		return false;

   for( i=0; (i < specialchars.length) && status==true; i++ )
	   if( email_address.indexOf(specialchars.charAt(i)) !=  -1 )
			return false;

   return true;
}
