
// Feedback form validation
function Feedback() {

	firstName = document.fbForm.txtFirstname
	if (firstName.value == "" || !isNaN(firstName.value))
	{
		alert("Please enter your first name");
		firstName.focus()
		return false		
	}

	lastName = document.fbForm.txtlastname
	if (lastName.value == "" || !isNaN(lastName.value))
	{
		alert("Please enter your last name");
		lastName.focus()
		return false		
	}

	mailid = document.fbForm.txtemail
	if (mailid.value == '')
	{
		alert("Please enter E-mail Id");
		mailid.focus()
		return false
	}
	else if (mailid.value.indexOf("@")==-1 || mailid.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		mailid.focus()	   
		return false
	}

	age = document.fbForm.cmbAgeRange
	if (age.options[age.selectedIndex].value == "")
	{
		alert("Please select your age group");
	age.focus()
	return false		
	}	

	sportsAct = document.fbForm.txtsports
	if (sportsAct.value != "" && !isNaN(sportsAct.value))
	{
		alert("Please enter Sports Activities");
		sportsAct.focus()
		return false		
	}

	comments = document.fbForm.txtComments
	if (comments.value == "" || !isNaN(comments.value))
	{
		alert("Please add your comments");
		comments.focus()
		return false		
	}	
	if (document.fbForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.fbForm.uword.focus();
	return false;
	}
	return jcap();
	
	
}

// Appointments form validation
function Appointment()
{
if (document.frmAppointment.txtFirstName.value=="" || !isNaN(document.frmAppointment.txtFirstName.value))
	{
	alert('Enter FirstName');
	document.frmAppointment.txtFirstName.focus();
	return false;
	}
if (document.frmAppointment.txtSurname.value=="" || !isNaN(document.frmAppointment.txtSurname.value))
	{
	alert('Enter Surname');
	document.frmAppointment.txtSurname.focus();
	return false;
	}
if (document.frmAppointment.txtHomePhoneNumber.value=="" )
	{
	alert('Enter Home Phone No.');
	document.frmAppointment.txtHomePhoneNumber.focus();
	return false;
	}
if (document.frmAppointment.txtBusinessPhoneNumber.value=="" )
	{
	alert('Enter a valid Business Phone Number');
	document.frmAppointment.txtBusinessPhoneNumber.focus();
	return false;
	}
	
if (document.frmAppointment.txtMobileNumber.value!="" )
	{
	alert('Mobile number you have entered is invalid');
	document.frmAppointment.txtMobileNumber.focus();
	return false;
	}
	
if (document.frmAppointment.txtEmailAddress.value=="")
	{
	alert('Enter Email Address');
	document.frmAppointment.txtEmailAddress.focus();
	return false;
	}
	else if (document.frmAppointment.txtEmailAddress.value.indexOf("@")==-1 || document.frmAppointment.txtEmailAddress.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		document.frmAppointment.txtEmailAddress.focus()	   
		return false
	}	
	
	if (document.frmAppointment.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.frmAppointment.uword.focus();
	return false;
	}
	return jcap();
}

//Random Images

                function getCookie(c_name)
                {
                if (document.cookie.length>0)
                  {
                  c_start=document.cookie.indexOf(c_name + "=")
                  if (c_start!=-1)
                    {
                    c_start=c_start + c_name.length+1
                    c_end=document.cookie.indexOf(";",c_start)
                    if (c_end==-1) c_end=document.cookie.length
                    return unescape(document.cookie.substring(c_start,c_end))
                    }
                  }
                return null
                }

                function randImagesCookie()
                {
                        if(getCookie('name')==null || getCookie('name')=="NaN")
                        {
                                document.cookie="name"+"="+1;
                        }
                        var cimgnum=getCookie('name');
                        if(cimgnum >= 4) {
                                var simgnum=1;
                        } else {
                                var simgnum=parseInt(cimgnum)+1;
                        }
						
						for(i=1; i<=4; i++)
						{
						
	                        var imagename = "cori_header_"+simgnum+"_"+i
	                        document.cookie="name"+"="+simgnum;

							var tmp = eval("document.getElementById('index"+i+"')")
    	                    var picPath="images/"+imagename+".jpg";
	                        tmp.style.backgroundImage="url('"+picPath+"')";
						}
                }





// Contact Us form validation
function Contactus() {
	
	firstName = document.cuForm.txtName
	if (firstName.value == "" || !isNaN(firstName.value))
	{
		alert("Please enter your first name");
		firstName.focus()
		return false		
	}

	mailid = document.cuForm.txtEmail
	if (mailid.value == '')
	{
		alert("Please enter E-mail Id");
		mailid.focus()
		return false
	}
	else if (mailid.value.indexOf("@")==-1 || mailid.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		mailid.focus()	   
		return false
	}

	comments = document.cuForm.txtMessage
	if (comments.value == "" || !isNaN(comments.value))
	{
		alert("Please add your comments");
		comments.focus()
		return false		
	}	
	if (document.cuForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.cuForm.uword.focus();
	return false;
	}
	return jcap();
	
	
}

// Check list form validation
function validation() {
	
	FirstName = document.checklist.FirstName
	if (FirstName.value == "" || !isNaN(FirstName.value))
	{
		alert("Please enter your first name");
		FirstName.focus()
		return false		
	}
	
		LastName = document.checklist.LastName
	if (LastName.value == "" || !isNaN(LastName.value))
	{
		alert("Please enter your Last name");
		LastName.focus()
		return false		
	}
	
	EmailAddress = document.checklist.EmailAddress
	if (EmailAddress.value == '')
	{
		alert("Please enter E-mail Id");
		EmailAddress.focus()
		return false
	}
	else if (EmailAddress.value.indexOf("@")==-1 || EmailAddress.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		EmailAddress.focus()	   
		return false
	}	
	if (document.checklist.HomePhone.value=="" )
	{
	alert('Enter a valid Business Phone Number');
	document.checklist.HomePhone.focus();
	return false;
	}	
	
	HomeCountry = document.checklist.HomeCountry
	if (HomeCountry.options[HomeCountry.selectedIndex].value == "" || age.options[HomeCountry.selectedIndex].value == null )
	{
		alert("Please select Procedure of Interest");
		HomeCountry.focus()
		return false		
	}	
	
	
	Comments = document.checklist.Comments
	if (Comments.value == "" || !isNaN(Comments.value))
	{
		alert("Please add your comments");
		Comments.focus()
		return false		
	}	
		Training = document.checklist.Training
	if (Training.options[Training.selectedIndex].value == "" || Training.options[Training.selectedIndex].value == null )
	{
		alert("Please select How did you find us?");
		Training.focus()
		return false		
	}
	
	
	
	if (document.checklist.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.checklist.uword.focus();
	return false;
	}
	return jcap();
	
	
}


function gallery(url,w,h)
{
	var mywin = window.open('','','width='+w+',height='+h+',scrollbars=0');
	
	var str = "";
	
		str = str + "<html><head><title>Original Floral Seascapes</title></head>";
		str = str + "<body leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0>";
		str = str + "<img src="+url+" width="+w+" height="+h+">";
		str = str + "</body></html>";
		
		mywin.document.write(str);
}

 // To open a popup window
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function openitCustom1(sURL){newwindow5=window.open(sURL,"newwin5","scrollbars=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, status=no, width=1024, height=900");
newwindow5.window.focus();}


