function getWebQuery(){
	if (document.forms.webassistant.webassistant.value != "") {
		var query = urlEncode(document.forms.webassistant.webassistant.value);
		openSearch(query);
	}
	else {
		openWebassistant();
	}
} 

function displayDate() 
{
	theDate = new Date();

 	var year = theDate.getYear();
 	var month = (theDate.getMonth())+1;
 	var day = theDate.getDate();

 	if (year < 1000) year+=1900;  
 	if (day  < 10) day="0"+day;
 	if (month < 10) month="0"+month;
					
	var myDate = "day.month.year";
				
	myDate = myDate.replace(/day/,day);
	myDate = myDate.replace(/month/,month);
	myDate = myDate.replace(/year/,year);

	if(document.getElementById)
	{
		if(document.getElementById("hsDate"))
		{
			document.getElementById("hsDate").innerHTML=myDate;
		}
	}
}

function getMainDate()
{
	 	var year = theDate.getYear();
 		var month = (theDate.getMonth())+1;
		
		if (year < 1000)
		{
			year+=1900;
		}
		
		var myDate = "month year";
		myDate = myDate.replace(/month/,monthArr[month]);
		myDate = myDate.replace(/year/,year);
		
		return myDate;
}

var param_mybosch_location = "http://www.bosch.ru/content/service/mb/loader.asp"; 
var param_sources_location = "http://www.bosch.ru/dealer/searchPartners.asp";
var param_contact_location = "http://www.bosch.ru/content/service/contact/index.asp";
var param_webassist_location = "http://www.bosch.ru/content/service/wa/index.asp";
var param_impressum_location = "/impressum/index.html";

var params = "width=565,height=510,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no";
var params1 = "width=564,height=510,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no";
var params2 = "width=564,height=510,toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=no";
var params3 = "width=564,height=510,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no";
var params4 = "width=540,height=291,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no";
//var gb="=%d0%ad%d0%bb%d0%b5%d0%ba%d1%82%d1%80%d0%be%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82%d1%8b";
var gb="";
var email="";
var languageMapping = new Array();
languageMapping["UKR"]="uk_UA";
languageMapping["ENG"]="en_US";
languageMapping["RUS"]="ru_RU";

function showStatus (msg)
{
	window.status = msg;
}

function getLang_ServiceFunctions(inLanguage)
{
	var lang_ServiceFunctions = new Array();
		lang_ServiceFunctions["UKR"]="uk";
		lang_ServiceFunctions["ENG"]="en";
		lang_ServiceFunctions["RUS"]="ru";

	return lang_ServiceFunctions[inLanguage];
}

function openMyBosch(){
	
   theStr="?locale=" + escape(curLanguage);
   window.open(param_mybosch_location+theStr, "mybosch","width=100,height=100,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no");
   
}
	
function openWebassistant(inInfo){
	myurl="http://servicefunctions.bosch.com/user/webassistant/search.asp?country=ru&lang="+getLang_ServiceFunctions(curLanguage);
     	window.open(myurl, "webassi", params2);
}

function openSearch(inInfo){
	myurl="http://servicefunctions.bosch.com/user/webassistant/search.asp?country=ru&lang="+getLang_ServiceFunctions(curLanguage)+"&query="+inInfo;
     	window.open(myurl, "webassi", params2);
}

function openSource(){	
	path = param_sources_location + "?";
	if (typeof (activity)=='undefined' ) {activity=0;}
	if (activity != 0) {
		path += "activity=" + activity + "&";
	}
	var theLanguage;
		if (curLanguage=="RUS"){theLanguage='ru';}
		if (curLanguage=="ENG"){theLanguage='en';}

	myurl = path+'lang='+theLanguage+'&gb='+gb+'&locale='+getLocale(curLanguage)+'&product=&opener='+ escape(self.location.href);
	window.open(myurl, "bezug", params);
}

function openImpressum(){
	var theLanguage;
		if (curLanguage=="RUS"){theLanguage='language1';}
		if (curLanguage=="ENG"){theLanguage='language2';}
		path = "/"+theLanguage+param_impressum_location;
		myurl = path;
   	window.open(myurl, "imprint", params1);  
   	return false;
}

function openInvented(){
	var theLanguage;
		if (curLanguage=="RUS"){theLanguage='ru';}
		if (curLanguage=="ENG"){theLanguage='en';}
		//path = "http://www.bosch.ru"+"/content/"+theLanguage+param_impressum_location;
		//#" onclick="javascript:window.open('http://header.bosch.com/claim/invented/index.asp?country=ru&lang=en', 'invented', 'width=540,height=291,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no');
		path = 'http://header.bosch.com/claim/invented/index.asp?country=ru&lang='+theLanguage;
		myurl = path;
	   	window.open(myurl, "imprint", params4);  

}

function openMail(e1_text, e2_text, e3_text){
     path = param_contact_location; 
     myurl="http://servicefunctions.bosch.com/user/contactdealer/form.asp?country=ru&lang=ru"+"&app=contact&oldid=&e1="+e1_text+"&e2="+e2_text+"&e3="+e3_text+"&opener=";
     window.open(myurl, "mail", params);
}

function openMail_en(e1_text, e2_text, e3_text){
     path = param_contact_location; 
     myurl="http://servicefunctions.bosch.com/user/contactdealer/form.asp?country=ru&lang=en"+"&app=contact&oldid=&e1="+e1_text+"&e2="+e2_text+"&e3="+e3_text+"&opener=";
     window.open(myurl, "mail", params);
}

