// FORM VALIDATION - QUICK ENQUIRY

function checkjoinform ( form1 )
{
	// ** START **
    if (form1.xname.value == "") {
        alert( "Please enter your Full Name" );
        form1.xname.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (form1.xemail.value == "") {
        alert( "Please enter your Email Address" );
        form1.xemail.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (form1.xphone.value == "") {
        alert( "Please enter your Phone Number" );
        form1.xphone.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (form1.xquest.value == "") {
        alert( "Please enter your Question" );
        form1.xquest.focus();
        return false ;
    }
    // ** END **
		return true ;
}



// FORM VALIDATION - GET A QUOTE

function checkjoinform2 ( quote1 )
{
	// ** START **	
	// Checking if at least one period button is selected. Or not. 
	if (!document.quote1.xhealthinfo[0].checked && !document.quote1.xhealthinfo[1].checked && !document.quote1.xhealthinfo[2].checked){ 
		alert("Please indicate type of Health Insurance"); 
		return false;}
    // ** END **
	// ** START **	
	// Checking if at least one period button is selected. Or not. 
	if (!document.quote1.xweare[0].checked && !document.quote1.xweare[1].checked && !document.quote1.xweare[2].checked){ 
		alert("Please indicate Single, Couple or Family"); 
		return false;}
    // ** END **
	// ** START **	
	// Checking if at least one period button is selected. Or not. 
	if (!document.quote1.xexistins[0].checked && !document.quote1.xexistins[1].checked){ 
		alert("Please indicate if you have Existing Health Insurance"); 
		return false;}
    // ** END **
	// ** START **
    if (quote1.xdob.value == "") {
        alert( "Please enter your Date of Birth or Age" );
        quote1.xdob.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (quote1.xname.value == "") {
        alert( "Please enter your Full Name" );
        quote1.xname.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (quote1.xstate.value == "Please Select") {
        alert( "Please select your State" );
        quote1.xstate.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (quote1.xpcode.value == "") {
        alert( "Please enter your Postcode" );
        quote1.xpcode.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (quote1.xemail.value == "") {
        alert( "Please enter your Email Address" );
        quote1.xemail.focus();
        return false ;
    }
	   // check for valid e-mail address
	if (quote1.xemail.value.indexOf("@")<1 ||
    	quote1.xemail.value.indexOf(".")==-1 ||
    	quote1.xemail.value.indexOf(",")!=-1 ||
    	quote1.xemail.value.indexOf(" ")!=-1 ||
    	quote1.xemail.value.length<6)
  	{
    	alert("Please enter a valid E-mail address.\n" +
    	"Example: myname@domainname.com");
    	quote1.xemail.focus();
    	return false
  	}
    // ** END **
	// ** START **
    if (quote1.xphoneh.value == "") {
        alert( "Please enter your Phone Number" );
        quote1.xphoneh.focus();
        return false ;
    }
    // ** END **
	// ** START **
    if (quote1.xcall.value == "Please Select") {
        alert( "Please select the Best Time for us to call" );
        quote1.xcall.focus();
        return false ;
	}
    // ** END **
		return true ;
}
//-->



// CLICK TO CALL

function ClicktoCall(id){
	var w=370;
	var h=450;
	var leftPos=(screen.width)?(screen.width-w)/2:100;
	var topPos=(screen.height)?(screen.height-h)/2:100;
	var
settings='width='+w+',height='+h+',top='+topPos+',left='+leftPos+',';
	settings =
settings+'location=no,directories=no,menubar=no,toolbar=no,';
	settings =
settings+'status=no,scrollbars=no,resizable=no,dependent=no';
	var
sUrl='http://www.nascomms.com/ccConnect/Dialer.aspx?clientId='+id;
	var ccWindow=window.open(sUrl,'ClickCalling',settings);
	ccWindow.focus();
}

