﻿function popISOCertWindow(popurl)
	{
		var title =""
		window.open(popurl,"","left=80,top=30,width=380,height=500,Scrollbars=No");
	}

function popScreenShotWindow(popurl)
	{
		var title =""
		window.open(popurl,"","left=155,top=120,width=690,height=500,Scrollbars=Yes");
	}
	
function ToggleFeature(id){
	var oimg=document.all.item(id);
	var odiv=document.all.item(id+"d");

	if (odiv.style.display=="none"){
		oimg.src = "images/minus.jpg";
		odiv.style.display = "";
	}else{
		oimg.src = "images/plus.jpg";
		odiv.style.display = "none";

	}
}

function ValidateContacts(theForm)
{

  if (theForm.ctl00_cphContentHeader_txtName.value == "")
  {
    alert("Please enter your name.");
    theForm.ctl00_cphContentHeader_txtName.focus();
    return (false);
  }

  if (theForm.ctl00_cphContentHeader_txtCompany.value == "")
  {
    alert("Please enter name of your organization.");
    theForm.ctl00_cphContentHeader_txtCompany.focus();
    return (false);
  }

  if (theForm.ctl00_cphContentHeader_txtLocation.value == "")
  {
    alert("Please enter your location.");
    theForm.ctl00_cphContentHeader_txtLocation.focus();
    return (false);
  }

	// Email validation starts
	BeforeAtRate = theForm.ctl00_cphContentHeader_txtEmail.value.substring(0,theForm.ctl00_cphContentHeader_txtEmail.value.indexOf("@"));
	AfterAtRate = theForm.ctl00_cphContentHeader_txtEmail.value.substring(theForm.ctl00_cphContentHeader_txtEmail.value.indexOf("@")+1,theForm.ctl00_cphContentHeader_txtEmail.value.length);
	if (AfterAtRate.indexOf(".") == -1)
	{
		alert("Please enter a valid email-id");
		theForm.ctl00_cphContentHeader_txtEmail.focus();
		return (false);
	}
	middle = AfterAtRate.substring(0, AfterAtRate.indexOf("."));
	last = AfterAtRate.substring(AfterAtRate.indexOf(".") + 1,AfterAtRate.length);
	if (BeforeAtRate.length == 0 || middle.length == 0 || last.length == 0)
	{
		alert("Please enter a valid email-id");
		theForm.ctl00_cphContentHeader_txtEmail.focus();
		return (false);
	}
	if (middle.indexOf(",") != -1 || last.indexOf(",") != -1 || middle.indexOf(",") != -1 || BeforeAtRate.indexOf(",") != -1){
		alert("Please enter a valid email-id");
		theForm.ctl00_cphContentHeader_txtEmail.focus();
		return (false);
	}
	// Email validation ends

  if (theForm.ctl00_cphContentHeader_txtPhone.value == "")
  {
    alert("Please enter phone number.");
    theForm.ctl00_cphContentHeader_txtPhone.focus();
    return (false);
  }
	
  if (theForm.ctl00_cphContentHeader_txtComments.value == "")
  {
    alert("Please enter your comments or proposals.");
    theForm.ctl00_cphContentHeader_txtComments.focus();
    return (false);
  }
	
}

