// JavaScript Document
function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}

function checkform(){
	var doc=document.form1;
	if(!doc.com_name.value.length)	{
		alert("Please Enter Your Company Name");
		doc.com_name.focus();
		return false;
	}
	if(!doc.email.value.length)	{
		alert("Please Enter Your EmailID");
		doc.email.focus();
		return false;
	}
	if(doc.email.value.indexOf('@')==-1 || doc.email.value.indexOf('.')==-1){
		alert("Please Enter Your EmailID Correctly");
		doc.email.value="";
		doc.email.focus();
		return false;
	}
	if(doc.vcountry.value==""){
		alert("Please Enter Your Country Name");
		doc.vcountry.focus();
		return false;
	}
	if(!doc.subject.value.length)	{
		alert("Please Enter Mail Subject");
		doc.subject.focus();
		return false;
	}
}
function checkrefer(){
	var doc=document.refer;
	if(!doc.your_name.value.length)	{
		alert("Please Enter Your Name");
		doc.your_name.focus();
		return false;
	}
	if(!doc.your_email.value.length)	{
		alert("Please Enter Your EmailID");
		doc.your_email.focus();
		return false;
	}
	if(doc.your_email.value.indexOf('@')==-1 || doc.your_email.value.indexOf('.')==-1){
		alert("Please Enter Your EmailID Correctly");
		doc.your_email.value="";
		doc.your_email.focus();
		return false;
	}
	if(!doc.friend_name.value.length)	{
		alert("Please Enter Your Friend Name");
		doc.friend_name.focus();
		return false;
	}
	if(!doc.friend_email.value.length)	{
		alert("Please Enter Your Friend EmailID");
		doc.friend_email.focus();
		return false;
	}
	if(doc.friend_email.value.indexOf('@')==-1 || doc.friend_email.value.indexOf('.')==-1){
		alert("Please Enter Your Friend EmailID Correctly");
		doc.friend_email.value="";
		doc.friend_email.focus();
		return false;
	}
}
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');
		}
	}
}