var RootPath = 'http://www.directories-today.com/newdto/';

var CorporateCompanies = RootPath + 'corp/jsp/Corporate.jsp';
var CompanyName = RootPath + 'ind/jsp/SearchPage.jsp?searchType=12&groupType=cpe';
var Classification = RootPath + 'ind/jsp/SearchPage.jsp?searchType=0&groupType=cpb';
var Products = RootPath + 'ind/jsp/SearchPage.jsp?searchType=6&groupType=cpb';
var Brands = RootPath + 'ind/jsp/SearchPage.jsp?searchType=5&groupType=cpb';
var PhoneFax = RootPath + 'ind/jsp/SearchPage.jsp?searchType=4&groupType=cpe';
var Email = RootPath + 'ind/jsp/SearchPage.jsp?searchType=13&groupType=cpe';
var EmailThanks = 'http://www.directories-today.com/popup/thanks_shah.htm';
var BusinessEnquiry = RootPath + 'ind/jsp/BusinessEnquiry.jsp';
var PopUpHTML = 'http://www.directories-today.com/popup/popup.html';
var PopUpTarget = RootPath + 'ind/dtoemail.do';

var Recipients = 'info@shahelectronics.net';
//var Recipients = 'kk@idil.com';
var Subject = 'Query through Directories Today';

var corpComp  = RootPath + 'corp/corpsearch.do?applicationInd=dto&searchCriteria=';
var CorpCompA = '<a href="' + corpComp + 'A"><font color="black">A</a>&nbsp;&nbsp;';
var CorpCompB = '<a href="' + corpComp + 'B"><font color="black">B</a>&nbsp;&nbsp;';
var CorpCompC = '<a href="' + corpComp + 'C"><font color="black">C</a>&nbsp;&nbsp;';
var CorpCompD = '<a href="' + corpComp + 'D"><font color="black">D</a>&nbsp;&nbsp;';
var CorpCompE = '<a href="' + corpComp + 'E"><font color="black">E</a>&nbsp;&nbsp;';
var CorpCompF = '<a href="' + corpComp + 'F"><font color="black">F</a>&nbsp;&nbsp;';
var CorpCompG = '<a href="' + corpComp + 'G"><font color="black">G</a>&nbsp;&nbsp;';
var CorpCompH = '<a href="' + corpComp + 'H"><font color="black">H</a>';
var CorpCompI = '<a href="' + corpComp + 'I"><font color="black">I</a>&nbsp;&nbsp;';
var CorpCompJ = '<a href="' + corpComp + 'J"><font color="black">J</a>&nbsp;&nbsp;';
var CorpCompK = '<a href="' + corpComp + 'K"><font color="black">K</a>&nbsp;&nbsp;';
var CorpCompL = '<a href="' + corpComp + 'L"><font color="black">L</a>&nbsp;&nbsp;';
var CorpCompM = '<a href="' + corpComp + 'M"><font color="black">M</a>&nbsp;&nbsp;';
var CorpCompN = '<a href="' + corpComp + 'N"><font color="black">N</a>&nbsp;&nbsp;';
var CorpCompO = '<a href="' + corpComp + 'O"><font color="black">O</a>&nbsp;&nbsp;';
var CorpCompP = '<a href="' + corpComp + 'P"><font color="black">P</a>';
var CorpCompQ = '<a href="' + corpComp + 'Q"><font color="black">Q</a>&nbsp;&nbsp;';
var CorpCompR = '<a href="' + corpComp + 'R"><font color="black">R</a>&nbsp;&nbsp;';
var CorpCompS = '<a href="' + corpComp + 'S"><font color="black">S</a>&nbsp;&nbsp;';
var CorpCompT = '<a href="' + corpComp + 'T"><font color="black">T</a>&nbsp;&nbsp;';
var CorpCompU = '<a href="' + corpComp + 'U"><font color="black">U</a>&nbsp;&nbsp;';
var CorpCompV = '<a href="' + corpComp + 'V"><font color="black">V</a>&nbsp;&nbsp;';
var CorpCompW = '<a href="' + corpComp + 'W"><font color="black">W</a>&nbsp;&nbsp;';
var CorpCompX = '<a href="' + corpComp + 'X"><font color="black">X</a>';
var CorpCompY = '<a href="' + corpComp + 'Y"><font color="black">Y</a>&nbsp;&nbsp;';
var CorpCompZ = '<a href="' + corpComp + 'Z"><font color="black">Z</a>';

function validateForm(inForm)
{
	if(inForm.companyName.value == "")
	{
		alert('Please enter company name.');
		inForm.companyName.focus();
		return false;
	}
	else if(inForm.name.value == "")
	{
		alert('Please enter your name.');
		inForm.name.focus();
		return false;
	}
	else if(inForm.telNo.value == "")
	{
		alert('Please enter contact number.');
		inForm.telNo.focus();
		return false;
	}
	else if(inForm.email.value == "")
	{
		alert('Please enter your mail.');
		inForm.email.focus();
		return false;
	}
	else if(echeck(inForm.email.value)!=true)
	{
		inForm.email.focus();
		return false;
	}
	else if(inForm.productsSvcLooking.value == "Products interested in : ")
	{
		//selObj.options[selObj.selectedIndex].value
		alert('Please select your interest from the list.');
		inForm.productsSvcLooking.focus();
		return false;
	}
	inForm.subject.value = Subject;
	inForm.recipients.value = Recipients;
	inForm.action = PopUpTarget;
	return true;
}
function echeck(str)
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1)
	{
	   alert("Invalid E-mail ID")
	   return false
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	{
	   alert("Invalid E-mail ID")
	   return false
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
	{
	    alert("Invalid E-mail ID")
	    return false
	}
	if (str.indexOf(at,(lat+1))!=-1)
	{
	    alert("Invalid E-mail ID")
	    return false
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
	{
	    alert("Invalid E-mail ID")
	    return false
	}
	if (str.indexOf(dot,(lat+2))==-1)
	{
	    alert("Invalid E-mail ID")
	    return false
	}
	if (str.indexOf(" ")!=-1)
	{
	    alert("Invalid E-mail ID")
	    return false
	}
return true					
}
