function openpopup(poppage)
{
    
	window.open(poppage, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=400,height=500');
}
function openpopupanc(poppage)
{
    
	window.open(poppage, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=550,height=490');
}
function redirectPage(sPageName)
{
	window.location=sPageName;
}


function doSubmit()
{

 	if (isWhitespace(document.frmemail.First_Name.value)) 
 	{
 	     alert("Please enter First Name!");
 	     document.frmemail.First_Name.focus();
 	     return false;
 	}  

	if (isWhitespace(document.frmemail.Last_Name.value)) 
	{
	     alert("Please enter Last Name!");
	     document.frmemail.Last_Name.focus();
	     return false;
	}  
	
 

	if ((!document.frmemail.Inquiry_Type[1].checked) && (!document.frmemail.Inquiry_Type[2].checked) && (!document.frmemail.Inquiry_Type[3].checked) && (!document.frmemail.Inquiry_Type[0].checked) )
	{
	     alert("Please enter Inquiry Type!");
	     document.frmemail.Inquiry_Type(1).focus();
	     return false;
	} 



	if (isWhitespace(document.frmemail.Email.value)) 
	{
	     alert("Please enter email! ");
	     document.frmemail.Email.focus();
	     return false;
	}  
	
	
	if (!isEmail(document.frmemail.Email.value)) 
	{
	     alert("Please enter a valid email address! ");
	     document.frmemail.Email.focus();
	     return false;
	}  
	
	if (isWhitespace(document.frmemail.Mobile.value)) 
	{
	     alert("Please enter your phone number!");
	     document.frmemail.Mobile.focus();
	     return false;
	}  
	
	if (document.frmemail.Mobile.value.length < 10) 
	{
	     alert("Please enter your phone number!");
	     document.frmemail.Mobile.focus();
	     return false;
	}  
	
	
	if (isWhitespace(document.frmemail.Comment.value)) 
	{
	     alert("Please enter your Message !");
	     document.frmemail.Comment.focus();
	     return false;
	}  

return true;
}


// JScript File

//_____________________      isWhitespace     _____________________________________________________________

function isWhitespace (s)

{   // Is s empty?
//    return (isEmpty(s));
    return (isEmpty(s) || reWhitespace.test(s));
}



//________________________________________________________________________________________________
//_____________________      warnEmpty     _____________________________________________________________

var reWhitespace = /^\s+$/
// warnEmpty (theField, s)             Notify user that required field theField is empty.


// Notify user that required field theField is empty.
// String s describes expected contents of theField.value.
// Put focus in theField and return false.

function warnEmpty (theField, s)
{   theField.focus()
    alert(mPrefix + s + mSuffix)
    return false
}


//________________________________________________________________________________________________
//_____________________      isEmpty     _____________________________________________________________

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}



//________________________________________________________________________________________________
//_____________________      isWhitespace     _____________________________________________________________

function isWhitespace (s)

{   // Is s empty?
//    return (isEmpty(s));
    return (isEmpty(s) || reWhitespace.test(s));
}



//________________________________________________________________________________________________
//_____________________      isNum     _____________________________________________________________

function isNum(chr)            // is character a number?
  {
  if (chr < "0" || chr > "9")  // nope
    return false;
  else                         // yep
    return true;
  }




//________________________________________________________________________________________________
//_____________________      isNumber09     _____________________________________________________________

function isNumber09(InString)  {
        RefString="0123456789";

        for (Count=0; Count < InString.length; Count++)  {
            TempChar= InString.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
				alert("Please enter numbers only: 0 - 9 ");
				return false;
			}
		}
        return true;
}


function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}


function clearCharacters( oCtrl ) {
	oCtrl.value = oCtrl.value.replace(/\D/g,'');
}