//<!--
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
condition = !(( (browserName.indexOf("Explorer") >=0 ) && (browserVer < 4) ) ||  ((browserName.indexOf("Netscape") >=0 ) && (browserVer < 2) ) ) ;
if (condition == true  )
    CanAnimate = true;
else
    CanAnimate = false;

function translator(pattern)
{
	var thisurl = 'http://translate.google.com/translate_c?langpair=' + pattern + "&u=" + document.location;
	if (CanAnimate ){
        	msgWindow=window.open('' ,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
	        msgWindow.focus();
        	msgWindow.location.href = thisurl;
	}
	else {
        	msgWindow=window.open(thisurl,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
	}
}

function mail(){
	document.location="mailto:travel.webmaster@indiamart.com?subject="+document.location;
}

function openchild_nl(thisurl) 
{
	var windowTop;
	var windowLeft;
	windowTop=(screen.height*(20/100))*0.7;
	windowLeft=screen.width*(19/100);

	var email_val = document.theForm.email.value;
	var from_site_val = document.theForm.from_site.value;
	var is_window_val = document.theForm.is_window.value;
	var org_referer = document.location;
	var thisurl_string = thisurl + "?email=" + email_val + "&from_site=" + from_site_val + "&is_window=" + is_window_val + "&org_referer=" + org_referer;

	if ( CanAnimate ) {
			msgWindow=window.open( '' ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=570,height=260,top='+windowTop+',left='+windowLeft);
			msgWindow.focus();
			msgWindow.location.href = thisurl_string;
	}
	else {
			msgWindow=window.open( thisurl_string,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=570,height=260,top='+windowTop+',left='+windowLeft);
	}
}



function validate_nl(theForm)
{
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.email.value)))
	{
		alert("Invalid Email ID. Kindly enter the correct ID.");
		theForm.email.focus();
		return (false);
	}
}


function getblank_nl(this1)  {
	this1.value = "";
    return true;	
}

function checkSearchTop()
{

	if (document.SearchTop.search.value.length < 3){
	    alert("Enter at least three characters for search."); 
	    document.SearchTop.search.focus();
	    return false;
	}
	return true;
}

function checkSearchBottom()
{

	if (document.SearchBottom.search.value.length < 3){
	    alert("Enter at least three characters for search."); 
	    document.SearchBottom.search.focus();
	    return false;
	}
	return true;
}

function openchild_email_this_page(thisurl){
	if ( CanAnimate ){
        msgWindow=window.open( '' ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=635,height=260');
        msgWindow.focus();
        msgWindow.location.href = thisurl;
	}
	else {
        msgWindow=window.open( thisurl,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=635,height=260');
	}
}


function check_form_email_this_page(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;
		}
	}

    if(form1.R_email3.value.length != 0)  
    {
        R_email3_val = checkform_email(form1.R_email3,"Kindly enter the Email ID of your friend / associate.");
        if(!R_email3_val) {
            return false;
        }
    }

    if(form1.R_email4.value.length != 0)  
    {
        R_email4_val = checkform_email(form1.R_email4,"Kindly enter the Email ID of your friend / associate.");
        if(!R_email4_val) {
            return false;
        }
    }

	//if (form1.message.value.length == 0){
	//	alert("Please write a message to your friend / associate."); 
	//	form1.message.focus();
	//	return false;
	//}

	else {
		return true;
	}	
}

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 addbookmark()
//{
//bookmarkurl="http://wwwJavascriptsource.com"
//bookmarktitle="Welcome To The Java Script Source"
//if (document.all)
//window.external.AddFavorite(bookmarkurl,bookmarktitle)
//}

function openchild_commercial(thisurl){
	if ( CanAnimate ){ 
        msgWindow=window.open( '' ,'subwindow');
        msgWindow.focus();
        msgWindow.location.href = thisurl;
	}
	else {
        msgWindow=window.open( thisurl,'subwindow');
	}       
}

function openchild_weather(cityid){
	var thisurl = "/includes/weather-average.cgi?i=" + cityid + "&t=c";
	if (CanAnimate ){ 
        msgWindow=window.open('','subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=400,height=450');
        msgWindow.focus();
        msgWindow.location.href = thisurl;
	}
	else {
        msgWindow=window.open(thisurl,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=no,menubar=no,resizable=yes,width=400,height=450');
	}       
}

function code_for_bookmark()	{
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		var url=document.location;
		var title = document.title;
		document.write('<A HREF="javascript:window.external.AddFavorite(url,title);" onMouseOver="window.status=\'Bookmark this page!\';return true;" onMouseOut="window.status=\'\';return true;"><IMG SRC=/includes/gifs/bookmark-this-page.gif ALT="Bookmark this page" WIDTH=15 HEIGHT=15 BORDER=0 HSPACE=3 VSPACE=0><FONT class="navsmall"><B>Bookmark this page</B></FONT></a>');
	}
	else {
		var msg = '<IMG SRC=/includes/gifs/bookmark-this-page.gif ALT="Bookmark this page" WIDTH=15 HEIGHT=15 BORDER=0 HSPACE=3 VSPACE=0><FONT class="navsmall"><B>Bookmark ';
		if (navigator.appName == "Netscape") {
			msg += "  (CTRL-D)</B></FONT>";
			document.write(msg);
		}
	}
}

function mail(){
	document.location="mailto:travel.webmaster@indiamart.com?subject="+document.location;
}
// -->


<!-- HIDING FROM OTHER BROWSERS
expires = new Date();
expires.setTime (expires.getTime() + 24 * 60 * 60 * 150 * 1000);
function set(){

	if (document.dataform.S_name.value == "") 
{
    alert ("Please fill Your Name.");
	document.dataform.S_name.focus();
    return (false);
}

if (document.dataform.S_email.value == "") 
{
    alert ("Please fill Your E-mail Id.");
	document.dataform.S_email.focus();
    return (false);
}

if(document.dataform.S_email.value.indexOf(" ") >= 0)
{
	alert("Please enter your email-id without any white space character.");
	document.dataform.S_email.focus();
	return (false);
}

if ( (document.dataform.S_email.value.indexOf("@") == -1) || (document.dataform.S_email.value.indexOf(".") == -1) )
{
	alert("Please enter a valid email-id"); 
	document.dataform.S_email.focus();
	return (false);
}


BeforeAtRate = document.dataform.S_email.value.substring(0,document.dataform.S_email.value.indexOf("@"));
AfterAtRate = document.dataform.S_email.value.substring(document.dataform.S_email.value.indexOf("@")+1,document.dataform.S_email.value.length);

if (AfterAtRate.indexOf(".") == -1)
{
	alert("Please enter a valid email-id"); 
	document.dataform.S_email.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"); 
	document.dataform.S_email.focus();
	return (false);
}

if (document.dataform.S_country.value == "") 
{
    alert ("Please fill Your Country Name.");
	document.dataform.S_country.focus();
    return (false);
}

if(document.dataform.Month_of_travel.selectedIndex==0)
	{
alert("Please tell us your Preferred Month of Travel");
document.dataform.Month_of_travel.focus();
return false;
	}

if(document.dataform.Year_of_travel.selectedIndex==0)
	{
alert("Please tell us your Preferred Year of Travel");
document.dataform.Year_of_travel.focus();
return false;
	}

	if(document.dataform.Number_of_adults.selectedIndex == 0)
{
	alert("Please select No. of Adults.");
	document.dataform.Number_of_adults.focus();
	return (false);
}

if(document.dataform.Number_of_children.selectedIndex == 0)
{
	alert("Please select No. of Children.");
	document.dataform.Number_of_children.focus();
	return (false);
}

if(document.dataform.Approx_budget_per_person_per_day.selectedIndex==0)
	{
alert("Please tell us your budget (per person per day)");
document.dataform.Approx_budget_per_person_per_day.focus();
return false;
	}

		if (document.dataform.Description.value == "") 
{
    alert ("Please enter your travel requirements.");
	document.dataform.Description.focus();
    return (false);
}

// Referrer and selfurl


if (document.referrer&&document.referrer!="")
        {
                document.dataform.referer.value = document.referrer;
        }
        document.dataform.self_url.value = document.location.href;
//
newCookie = document.dataform.S_name.value;
newCookie +="|"+document.dataform.S_email.value;
newCookie +="|"+document.dataform.S_country.value;
newCookie +="|";
setCookie("newImeshID",newCookie);
return true;
}
function get(){
if( (cookie = getCookie("newImeshID")) > ""){
	Values = cookie.split("|");
	if (Values.length >= 0){
		if (document.dataform.S_name.value.length == 0) document.dataform.S_name.value = Values[0];
		if (document.dataform.S_email.value.length == 0)    document.dataform.S_email.value = Values[1];
		if (document.dataform.S_country.value.length == 0)    document.dataform.S_country.value=Values[2];
	}
}
return true;
}
function setCookie(name, value){
if (value.length > 0)
 document.cookie = name + "=" + escape(value)+ ";"+"expires=" + expires.toGMTString()+";"+"path=/;"
}
function getCookie(Name) {
          var search = Name + "="
          if (document.cookie.length > 0) { // if there are any cookies
                    offset = document.cookie.indexOf(search) 
                    if (offset != -1) { // if cookie exists 
                              offset += search.length 
                              // set index of beginning of value
                              end = document.cookie.indexOf(";", offset) 
                              // set index of end of cookie value
                              if (end == -1) end = document.cookie.length
                              return unescape(document.cookie.substring(offset, end))
                    } 
          }
return "";
}
//Getting parameter name from url starts
var is_input = document.URL.indexOf('?');
var tour_value = '';
if (is_input != -1)
{
	addr_str = document.URL.substring(is_input+1, document.URL.length);
	strarr = addr_str.split("&");
	var param_name = unescape((strarr[0].split("="))[0]);
	if(param_name == "tour")
	{
		tour_value = unescape((strarr[0].split("="))[1]);
		tour_value = tour_value.replace(/\+/g," ");
	}
}
//Getting parameter name from url ends
// STOP HIDING FROM OTHER BROWSERS -->


function openNewWindow(w,h)
{
var nw=w+10;
var nh=h+10;
windowfeatures="'toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=yes,width="+nw+",height="+nh+"'";
newWindow=window.open( '' ,'subwindow',windowfeatures);
} 

function opencertificate()
{
window.open('iso-certificate.html','welcome','width=518,height=707,scrollbars=yes');
}
