function emailThisPage(rUrl) {
	
    var target = document.location;

  	var win = window.open(''+rUrl+'/email_with_us.htm?sendurl=' + target, 'notice', 'width=600,height=500,location=no,toolbar=no,status=no,resizable=no,scrollbars=yes');
  	win.focus();
}

function addToFavorite(){
	
	var titleVar = document.title;
	
	var urlVar = document.location;
	
	// firefox
	if (window.sidebar) {
		window.sidebar.addPanel(titleVar, urlVar, "");
	}
	// opera
	else if(window.opera && window.print) { 
		var elem = document.createElement('a');
		elem.setAttribute('href',urlVar);
		elem.setAttribute('title',titleVar);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	// ie
	else  {
		window.external.AddFavorite(urlVar,titleVar)
	}	

}

function firefoxAlert(pageurl) {
	
	if(navigator.appName=="Microsoft Internet Explorer") {
		
		pageurl.style.behavior='url(#default#homepage)';pageurl.setHomePage('http://www.indianyellowpages.com');
	}
	else {
		alert('To set Indianyellowpages.com as your home page in Firefox, click and drag the button to the "Home" icon in your browser.');
	}
	return false;
}
function openwin1(file,Iwidth,Iheight) {
      var newWin1=window.open(file,'nWin2','x=0,y=0,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes, copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
}

function vanity_inquire_now() {
    var pp=1;
    dml=document.form1;
    len=dml.elements.length;
    var i=0;
    for(i=0; i<len; i++) {
       if (dml.elements[i].type == "checkbox" && dml.elements[i].name != "checked_1"  && dml.elements[i].checked==true) {
          pp=2;
       }
    }
    if (pp==1) {
      	alert("You have not selected any party.\n\nPlease select the parties && then proceed");
    }
    else {
      	document.form1.submit();
    }
}

function checkAll(val) {
   	dml=document.form1;
   	len=dml.elements.length;
   	var i=0;
   	for (i=0; i<len; i++) {
     	if (document.form1.elements[i].type == "checkbox") {
        	if (val == 1) {
           		dml.elements[i].checked=true;
        	} 
			else {
           		dml.elements[i].checked=false;
        	}
     	}   
   	}
}

function vanity_search(chk1) {	
   if (chktrim(chk1.srch_kword.value)=="" || chk1.srch_kword.value=="Enter Keywords Here . . .") {
      alert("Enter Product / Services Keyword(s)");
      chk1.srch_kword.focus();
	  return false;
  }
}

function chktrim(inputString) {
	if (typeof inputString != "string") { return inputString; }
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	while (ch == " ") { 
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	} 
	ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") { 
		retValue = retValue.substring(0, retValue.length-1);
		ch = retValue.substring(retValue.length-1, retValue.length);
	}
	while (retValue.indexOf("  ") != -1) { 
		retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	}
	return retValue; 
}