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 botProLinks()
{	
	var _botProLinks=document.getElementById('botProLinks').offsetWidth;
	var _botProLinks02=window.document.body.clientWidth;
		
	document.getElementById('botProLinks').style.marginLeft=eval(parseInt((_botProLinks02-_botProLinks)/2)) +'px';
}

window.onload=function() {
	botProLinks();
}

/********** ROLLOVER-OUT FUNCTIONS **********/
function mOver(name)
{
	if (document.images)
	{
		picOver=eval(name + "_over.src");
		document[name].src=picOver;
	}
//	alert("over");
}


function mOut(name)
{
	if (document.images)
	{
		picOver=eval(name + ".src");
		document[name].src=picOver;
	}
//	alert("out");
}

/********** ROLLOVER-OUT FUNCTIONS **********/
function mOver1(name)
{
	if (document.images)
	{
		picOver=eval(name + ".src");
		document[name].src=picOver;
	}
//	alert("over");
}


function mOut1(name)
{
	if (document.images)
	{
		picOver=eval(name + "_over.src");
		document[name].src=picOver;
	}
//	alert("out");
}


function chk1(chk1) {
		
   	if ( chktrim(chk1.term.value).length <=1 || ( chktrim(chk1.term.value).length >=1 && chk1.term.value=="Enter Keywords")) {
		alert("Enter Product / Services Keyword(s)");
      	chk1.term.focus();
	  	return false;
   	}
   	if (chk1.busty.options[chk1.busty.selectedIndex].value == "") {
      	alert("Select a Searching Category");
      	chk1.busty.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; 
}


/*function  to translate the whole page in different languages but only in online*/
function translator(pattern) {
	var open_in_same_window = 1;
	var my_location = unescape(document.location.toString());
	var new_location ='';
	var new_pattern = '';
	if (my_location.indexOf('translate_c?') != -1) {
		/// From google...
		var indexof_u = my_location.indexOf('u=');
		if (indexof_u == -1) {
			new_location = document.location;
		}
		else {
			var subs = my_location.substring(indexof_u, my_location.length);
			var ss = subs.split('&');
			new_location = ss[0].substring(2, ss[0].length);
		}
	}
	else {
		new_location = document.location;
	}

	indexof_p = pattern.indexOf('|');

	var isen = '';
	if (indexof_p == -1) {
		indexof_p1 = pattern.indexOf('><');
		if (indexof_p1 == -1) {
			new_pattern = pattern;
			if (pattern == 'en') {
				isen = 1;
			}
		}
		else {
			var psplit =pattern.split('><');
			new_pattern = psplit[0]+'|'+psplit[1];
			if (psplit[1] == 'en') {
				isen = 1;
			}
		}
	}
	else {
		var psplit = pattern.split('|');
		new_pattern = psplit[0]+'|'+psplit[1];
		if (psplit[1] == 'en') {
			isen = 1;
		}
	}

	var thisurl = '';
	if (isen == 1) {
		thisurl = new_location;
	}
	else {
		thisurl = 'http://translate.google.com/translate_c?langpair=' + new_pattern + "&u=" + new_location;
	}

	if (open_in_same_window == 1) {
		window.location.href = thisurl;
	}
	else {
		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 openwin1(file,Iwidth,Iheight) {
	
	var newWin1=window.open(file,'iypWin2','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes, copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
}