function check_form(form1)
{
	if (form1.S_name.value.length == 0){
		alert("Kindly enter your name."); 
		form1.S_name.focus();
		return false;
	}
    	S_email_val = checkform_email(form1.S_email,"Kindly enter your Email address.");
	if(!S_email_val) {
		return false;
	}

	R_email1_val = checkform_email(form1.R_email1,"Kindly enter the Email ID of your friend / associate.");
	if(!R_email1_val) {
		return false;
	}

	if(form1.R_email2.value.length != 0)
	{
		R_email2_val = checkform_email(form1.R_email2,"Kindly enter the Email ID of your friend / associate.");
		if(!R_email2_val) {
			return false;
		}
	}
}


function checkform_email(EMAIL,CMESSAGE)
{
    if (EMAIL.value.length == 0){
        alert(CMESSAGE);
	    EMAIL.focus();
    	return false;
	}

	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(EMAIL.value)))
	{
		alert("Invalid Email ID. Kindly enter the correct ID.");
		EMAIL.focus();
		return (false);
	}

	else
	{
        return true;
	}
 }

 function openchild(thisurl){

        msgWindow=window.open( '' ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=600,height=400,left=0,top=0');
        msgWindow.focus();
        msgWindow.location.href = thisurl;
}


