if (document.images) 
{
   img1 = new Image();
   img2 = new Image();
   img1.src = "layout/global_img/img-hdr-goldbars.png";
   img2.src = "layout/global_img/btn_top_gobutton.png"
}
function articlesbox_hoverbotton (bottonNumber){
	document.getElementById("articlesbox_left_botton_"+bottonNumber).style.backgroundImage="url(layout/global_img/articlesbox/botton_left_on.png)";
	document.getElementById("articlesbox_background_botton_"+bottonNumber).style.backgroundImage="url(layout/global_img/articlesbox/botton_background_on.png)";	
	document.getElementById("articlesbox_right_botton_"+bottonNumber).style.backgroundImage="url(layout/global_img/articlesbox/botton_right_on.png)";
	return true;
}
function articlesbox_outbotton (bottonNumber){
	if(articlesbox_button_down != bottonNumber){
		document.getElementById("articlesbox_left_botton_"+bottonNumber).style.backgroundImage="url(layout/global_img/articlesbox/botton_left_off.png)";
		document.getElementById("articlesbox_background_botton_"+bottonNumber).style.backgroundImage="url(layout/global_img/articlesbox/botton_background_off.png)";	
		document.getElementById("articlesbox_right_botton_"+bottonNumber).style.backgroundImage="url(layout/global_img/articlesbox/botton_right_off.png)";
	}
	return true;
}
function press_tab_button (){
	document.getElementById("articlesbox_left_botton_"+articlesbox_button_down).style.backgroundImage="url(layout/global_img/articlesbox/botton_left_on.png)";
	document.getElementById("articlesbox_background_botton_"+articlesbox_button_down).style.backgroundImage="url(layout/global_img/articlesbox/botton_background_on.png)";	
	document.getElementById("articlesbox_right_botton_"+articlesbox_button_down).style.backgroundImage="url(layout/global_img/articlesbox/botton_right_on.png)";
}
function upress_tab_button (){
	document.getElementById("articlesbox_left_botton_"+articlesbox_button_down).style.backgroundImage="url(layout/global_img/articlesbox/botton_left_off.png)";
	document.getElementById("articlesbox_background_botton_"+articlesbox_button_down).style.backgroundImage="url(layout/global_img/articlesbox/botton_background_off.png)";	
	document.getElementById("articlesbox_right_botton_"+articlesbox_button_down).style.backgroundImage="url(layout/global_img/articlesbox/botton_right_off.png)";
}
var articlesbox_button_down = 1;
function articlesbox_show_tab(tabNumber){
	document.getElementById("articlesbox_"+articlesbox_button_down).style.display="none";
	document.getElementById("articlesbox_"+tabNumber).style.display="block";
	upress_tab_button ();
	articlesbox_button_down = tabNumber;
	press_tab_button();
}
function open_print_window(link) {
	if(link == ""){
		return false;
	}
	winprops = 'width=735,height=650,left= 150,top=100,scrollbars=yes,menubar=no,resizable=no';
	window.open(link, "print", winprops);
}
function open_window(link) {
	if(link == ""){
		return false;
	}
	window.open(link);
}
function clearInput(var_input){
	var default_string = "szukaj w serwisie";
	if(var_input.value == default_string){
		var_input.value = "";	
	}	
}
function pasteInput(var_input){
	var default_string = "szukaj w serwisie";
	if(var_input.value == ""){
		var_input.value = default_string;	
	}	
}
function checkmail(var_input){
     var check=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
     return !var_input.search(check);
} 
function checkcity(var_input) {
   var check=/^[a-zA-Z±æê³ñó¶¿¼¡ÆÊ£ÑÓ¦¯¬ -]*$/;
   return !var_input.search(check);
}

function sprod(select) {
	var query = document.location.search.substring(1);
	var s = query.split('&');
	var vars = new Array();
	var result ='?';

	// splitting query
	for(i in s) {
		d=s[i].split('=');
		vars[d[0]]=d[1];
	}

	// putting select value into query
	for(i in vars) {
		if(select.name==i) {
			vars[i]=select.value
		} 
		else {
			vars[select.name]=select.value
		}
	}

	// completing query again
	for(i in vars) {
		if(vars[i]!=undefined) {
			result+=i+'='+vars[i]+'&';
		}
	}
	
	// cut the last &amp; sign
	result=result.substr(0,result.length-1);
	
	document.location.href='index.php'+result

}
function focus_to_on_full(max_lenght, object_curr_name, object_next_name){
	var object_curr = document.getElementById(object_curr_name);
	var object_next = document.getElementById(object_next_name);
	if(object_curr.value.length >= max_lenght){
		object_next.select();
		object_next.focus();
	}
}
function focus_back_on_backspace(object_curr_name, object_next_name){
	var object_curr = document.getElementById(object_curr_name);
	var object_next = document.getElementById(object_next_name);
	if(object_curr.value.length == 0){
		object_next.select();
		object_next.focus();
	}
}
function pokazZajawki(){
	document.getElementById("DivLvl_abs_Intro_Links").style.top = "94px";
}
function show_products_to_print(path_string){
	var path = "print_tpl.php?type=products_list&products=" + path_string;
	var new_window = window.open(path,null, "top=100,width=750,left=200,height=600, location=no,menubar=no, resizable=no, scrollbars=yes, status=no, toolbar=no");
}
Array.prototype.search = Array_search;
function Array_search(find){
	var i;
	for(i=0;i<this.length && this[i]!=find;i++);
	if(i<this.length){
		return i;
	}else{
		return false;
	}
}





