﻿var button=false;
var imie=false;
var nazwisko=false;
var ulica=false;
var nr_mieszkania=false;
var miasto=false;
var email=false;
var kod=false;
var gg=true;
var interval;
var ilosc_zdjec=26;

var ajaxManager = $.manageAjax.create('cacheQueue', { 
    queue: true,  
    cacheResponse: false, 
	maxRequests: 2,
	preventDoubbleRequests: true
}); 



$.ajaxSetup({
contentType: "application/x-www-form-urlencoded; charset=utf-8"
});

function show_div(obj,loader,opt,start)
{	
	div = document.getElementById(obj);
	w=div.style.width;
	l=w.substr(0,w.indexOf("px"));
	l=Math.floor(l/2)-16;
	h=div.style.width;
	h=h.substr(0,h.indexOf("px"));
	h=Math.floor(h/2)-16;	
	if(loader==true)
	{
		if(!(document.getElementById("image-loading"+div.id)))
		{
			div2= document.createElement("div");
			div2.setAttribute("id","image-loading"+div.id);
			div2.setAttribute("name","image-loading"+div.id);
			div2.style.width="32px";
			div2.style.height="32px";
			div2.style.position="absolute";
			div2.style.left=l+"px";
			div2.style.top=h+"px";
			div2.style.backgroundColor="blue";
			div2.style.display="none";
			img = document.createElement("img");
			img.setAttribute("id","img"+div.id);
			img.setAttribute("src","/holdinwest/application/images/ajax/loader.gif");
			div2.appendChild(img);
			div.appendChild(div2);
		}
		else
		{
			div2=document.getElementById("image-loading"+div.id);
		}
	}
	
	if(!(document.getElementById("image-src"+div.id)))
	{
		div.innerHTML="";
		div3= document.createElement("div");
		div3.setAttribute("id","image-src"+div.id);
		div3.setAttribute("name","image-src"+div.id);
		div3.style.width=(l+16)+"px";
		div3.style.height=(h+16)+"px";
		div3.style.position="relative";
		div3.style.display="none";
		div3.style.zIndex="600";
		div.appendChild(div3);
	}
	else
	{
		div3=document.getElementById("image-src"+div.id);
		$("#image-src"+div.id).fadeOut("slow");
	}
	if(loader)
		$("#image-loading"+div.id).fadeIn("slow");
		
	if(opt==1)
	{	
		var zmienne="load=1&div_id="+div.id;

	}
	else
	{
		var zmienne="load=1&div_id="+div.id+"&back=2";
	}
	if(start!=0)
	{
		zmienne=zmienne+"&strt="+start;
	}
	//alert(zmienne);

  ajaxManager.add({
     type: "POST",
	 url: "http://holdinwest.pl/get_img_name.php",
	 data: zmienne,
	 success: function(response){

	//alert(div.id);
	//alert(response);

		if(loader)
			$("#image-loading"+div.id).fadeOut("slow");
		id=response.substr(0,response.indexOf("&&"));
		response=response.substr(response.indexOf("&&")+2);
		tekst=response.substr(response.indexOf("&&")+2);
		response=response.substr(0,response.indexOf("&&"));
		
		div3=document.getElementById("image-src"+id);
			div3.innerHTML='';
		
		start_nr = response.substr(24);
		start_nr = start_nr.substr(0,start_nr.indexOf("."));

		
		
		start_nr = Number(start_nr);

		if((start_nr > 2) && (start_nr < (ilosc_zdjec - 1)))
		{
			nr_1=Number(start_nr)-2;
			nr_2=Number(start_nr)-1;
			nr_3=Number(start_nr)-0;
			nr_4=Number(start_nr)+1;
			nr_5=Number(start_nr)+2;
		}
		else
		{
			if(start_nr == 2)
			{
				nr_1=ilosc_zdjec;
				nr_2=1;
				nr_3=Number(start_nr)-0;
				nr_4=Number(start_nr)+1;
				nr_5=Number(start_nr)+2;
			}
			if(start_nr == 1)
			{
				nr_1=ilosc_zdjec-1;
				nr_2=ilosc_zdjec;
				nr_3=Number(start_nr)-0;
				nr_4=Number(start_nr)+1;
				nr_5=Number(start_nr)+2;
			}
			if(start_nr == ilosc_zdjec)
			{
				nr_1=ilosc_zdjec-2;
				nr_2=ilosc_zdjec-1;
				nr_3=Number(start_nr)-0;
				nr_4=1
				nr_5=2
			}
			if(start_nr == (ilosc_zdjec-1))
			{
				nr_1=ilosc_zdjec-3;
				nr_2=ilosc_zdjec-2;
				nr_3=Number(start_nr)-0;
				nr_4=Number(start_nr)+1;
				nr_5=1;
			}
		}


		
		miniatury = document.getElementById("miniatury");
		
		miniatury.innerHTML="";
		miniatury.innerHTML= miniatury.innerHTML+'<div style="margin-right:2px;width:156px; height:120px;position:relative; float:left"><a href="#"onClick="select_nr('+nr_1+');return false;"><img  src="http://www.holdinwest.pl/application/images/adv/min/'+(nr_1)+'.jpg"  height="104px"  style="float:left;position: relative;"/></a></div>';
		miniatury.innerHTML= miniatury.innerHTML+'<div style="margin-right:2px;width:156px; height:120px;position:relative; float:left"><a href="#"onClick="select_nr('+nr_2+');return false;"><img  src="http://www.holdinwest.pl/application/images/adv/min/'+(nr_2)+'.jpg"  height="104px"  style="float:left;position: relative;"/></a></div>';
		miniatury.innerHTML= miniatury.innerHTML+'<div style="margin-right:2px;width:156px; height:120px;position:relative; float:left"><a href="#"onClick="select_nr('+nr_3+');return false;"><img  src="http://www.holdinwest.pl/application/images/adv/min/'+(nr_3)+'.jpg"  height="104px"  style="float:left;position: relative;"/></a></div>';
		miniatury.innerHTML= miniatury.innerHTML+'<div style="margin-right:2px;width:156px; height:120px;position:relative; float:left"><a href="#"onClick="select_nr('+nr_4+');return false;"><img  src="http://www.holdinwest.pl/application/images/adv/min/'+(nr_4)+'.jpg"  height="104px"  style="float:left;position: relative;"/></a></div>';
		miniatury.innerHTML= miniatury.innerHTML+'<div style="width:156px; height:120px;position:relative; float:left"><a href="#"onClick="select_nr('+nr_5+');return false;"><img src="http://www.holdinwest.pl/application/images/adv/min/'+(nr_5)+'.jpg"  height="104px"  style="float:left;position: relative;"/></a></div>';
		

		img = document.createElement("img");
		img.setAttribute("src",response);
		//img.setAttribute("width","405px");
		//img.setAttribute("height","304px");
		div3.appendChild(img);
		div3.innerHTML=div3.innerHTML+"<div style='width: 405px;'><b>"+tekst+"</b></div>";
		$("#image-src"+id).fadeIn("slow");
	 }
	});
}
interval = setInterval("show_div('adv1',false,1,0);",15000);
function select_nr(number)
{
	clearInterval(interval);
	show_div('adv1',false,1,number);
	interval = setInterval("show_div('adv1',false,1,0);",15000);
}
function next()
{
	clearInterval(interval);
	show_div('adv1',false,1,0);
	interval = setInterval("show_div('adv1',false,1,0);",15000);
}

function back()
{
	clearInterval(interval);
	show_div('adv1',false,2,0);
	interval = setInterval("show_div('adv1',false,2,0);",15000);
}

function init(){
	image1 = new Image(); 
	image1.src = "/holdinwest/application/images/layout/images_choice_10.png";
	image2 = new Image(); 
	image2.src = "/holdinwest/application/images/layout/images_choice_11.png";
	image3 = new Image(); 
	image3.src = "/holdinwest/application/images/layout/images_choice_12.png";
	image4 = new Image(); 
	image4.src = "/holdinwest/application/images/layout/images_choice_13.png";
	image5 = new Image(); 
	image5.src = "/holdinwest/application/images/layout/images_choice_14.png";
	image6 = new Image(); 
	image6.src = "/holdinwest/application/images/layout/images_choice_15.png";
	image7 = new Image(); 
	image7.src = "/holdinwest/application/images/layout/images_choice_16.png";
	image8 = new Image(); 
	image8.src = "/holdinwest/application/images/adv/1.jpg";
	image9 = new Image(); 
	image9.src = "/holdinwest/application/images/adv/2.jpg";
	image10 = new Image(); 
	image10.src = "/holdinwest/application/images/adv/3.jpg";
	image11 = new Image(); 
	image11.src = "/holdinwest/application/images/adv/4.jpg";
	image12 = new Image(); 
	image12.src = "/holdinwest/application/images/adv/5.jpg";
	image13 = new Image(); 
	image13.src = "/holdinwest/application/images/adv/6.jpg";
	image14 = new Image(); 
	image14.src = "/holdinwest/application/images/adv/7.jpg";
	image15 = new Image(); 
	image15.src = "/holdinwest/application/images/adv/8.jpg";
	image16 = new Image(); 
	image16.src = "/holdinwest/application/images/adv/9.jpg";
	image17 = new Image(); 
	image17.src = "/holdinwest/application/images/adv/10.jpg";
	image18 = new Image(); 
	image18.src = "/holdinwest/application/images/ajax/arrow_right_hover.png";
	image19 = new Image(); 
	image19.src = "/holdinwest/application/images/ajax/arrow_left_hover.png";
	image20 = new Image(); 
	image20.src = "/holdinwest/application/images/layout/dom_drewno.png";
	image21 = new Image(); 
	image21.src = "/holdinwest/application/images/layout/obrobka_drewno.png";
	image22 = new Image(); 
	image22.src = "/holdinwest/application/images/layout/mosty.png";
	image23 = new Image(); 
	image23.src = "/holdinwest/application/images/layout/uzytecznosc.png";
	image24 = new Image(); 
	image24.src = "/holdinwest/application/images/layout/images_choice_04.png";
	image25 = new Image(); 
	image25.src = "/holdinwest/application/images/layout/images_choice_17.png";
	image26 = new Image(); 
	image26.src = "/holdinwest/application/images/adv/11.jpg";
	
	$(function() {
	    $('#gallery a').lightBox();
	});
	
	
  }

function loadNewPage(obj,temp) {
	var req = new XMLHttpRequest();
	req.open("GET", temp, false);
	req.send(null);
	var page = req.responseText;
	document.getElementById(obj).innerHTML = document.getElementById(obj).innerHTML + page;
	}

function mosty()
{
 var browser=navigator.appName;
 
  if (window.innerWidth || window.innerHeight){ 
  docwidth = window.innerWidth; 
  docheight = window.innerHeight; 
  } 

  if (document.body.clientWidth || document.body.clientHeight){ 
  docwidth = document.body.clientWidth; 
  docheight = window.screen.height; 
  } 
  
  div=document.createElement("div");
  div.setAttribute("id","okno");
  div.style.width=(docwidth)+"px";
  div.style.height=(docheight)+"px";
  div.style.backgroundColor="black";
  div.style.position="absolute";
  div.style.zIndex=500;
  if (browser=="Microsoft Internet Explorer")
  {
   div.style.filter = 'alpha(opacity=50)';
  }
  else
  {
  div.style.opacity=0.8;
  }
  
 
  div2=document.createElement("div");
  div2.setAttribute("id","input");
  div2.style.width="660px";
  div2.style.height="370px";
  div2.style.backgroundColor="white";
  div2.style.position="relative";
  div2.style.zIndex=501;
   if (browser=="Microsoft Internet Explorer")
  {
   div2.style.filter = 'alpha(opacity=100)';
  }
  else
  {
	div2.style.opacity=1.0;
  }
    
  div2.style.left="50%";
  div2.style.top="400px";
  
  div3 = document.createElement("div");
  div3.setAttribute("id", "close");
  div3.style.width ="18px";
  div3.style.height ="18px";
  div3.style.position="absolute";
  div3.style.backgroundColor="black";
  //div3.style.left="640px";
  div3.className="close";
  div3.setAttribute("onclick","close_window();");
  
 
  div2.appendChild(div3);
  document.getElementById("popup").appendChild(div);
  document.getElementById("popup").appendChild(div2);
  
  loadNewPage("input","/holdinwest/application/views/mosty.html");
 }

function uzytecznosc()
{
 var browser=navigator.appName;
 
  if (window.innerWidth || window.innerHeight){ 
  docwidth = window.innerWidth; 
  docheight = window.innerHeight; 
  } 

  if (document.body.clientWidth || document.body.clientHeight){ 
  docwidth = document.body.clientWidth; 
  docheight = window.screen.height; 
  } 
  
  div=document.createElement("div");
  div.setAttribute("id","okno");
  div.style.width=(docwidth)+"px";
  div.style.height=(docheight)+"px";
  div.style.backgroundColor="black";
  div.style.position="absolute";
  div.style.zIndex=500;
  if (browser=="Microsoft Internet Explorer")
  {
   div.style.filter = 'alpha(opacity=50)';
  }
  else
  {
  div.style.opacity=0.8;
  }
  
 
  div2=document.createElement("div");
  div2.setAttribute("id","input");
  div2.style.backgroundColor="white";
  div2.style.position="relative";
  div2.style.zIndex=501;
   if (browser=="Microsoft Internet Explorer")
  {
   div2.style.filter = 'alpha(opacity=100)';
  }
  else
  {
	div2.style.opacity=1.0;
  }
    
  div2.style.left="50%";
  div2.style.top="400px";
  
  div3 = document.createElement("div");
  div3.setAttribute("id", "close");
  div3.style.width ="18px";
  div3.style.height ="18px";
  div3.style.position="absolute";
  div3.style.backgroundColor="black";
  //div3.style.left="640px";
  div3.className="close";
  div3.setAttribute("onclick","close_window();");
  
 
  div2.appendChild(div3);
  document.getElementById("popup").appendChild(div);
  document.getElementById("popup").appendChild(div2);
  
  loadNewPage("input","/holdinwest/application/views/uzytecznosc.html");
 }

function szkielet()
{
 var browser=navigator.appName;
 
  if (window.innerWidth || window.innerHeight){ 
  docwidth = window.innerWidth; 
  docheight = window.innerHeight; 
  } 

  if (document.body.clientWidth || document.body.clientHeight){ 
  docwidth = document.body.clientWidth; 
  docheight = window.screen.height; 
  } 
  
  div=document.createElement("div");
  div.setAttribute("id","okno");
  div.style.width=(docwidth)+"px";
  div.style.height=(docheight)+"px";
  div.style.backgroundColor="black";
  div.style.position="absolute";
  div.style.zIndex=500;
  if (browser=="Microsoft Internet Explorer")
  {
   div.style.filter = 'alpha(opacity=50)';
  }
  else
  {
  div.style.opacity=0.8;
  }
  
 
  div2=document.createElement("div");
  div2.setAttribute("id","input");
  div2.style.width="660px";
  div2.setAttribute("style", "wdith: 660px;")
  div2.style.height="370px";
  div2.style.backgroundColor="white";
  div2.style.position="relative";
  div2.style.zIndex=501;
   if (browser=="Microsoft Internet Explorer")
  {
   div2.style.filter = 'alpha(opacity=100)';
  }
  else
  {
	div2.style.opacity=1.0;
  }
    
  div2.style.left="50%";
  div2.style.top="400px";
  
  div3 = document.createElement("div");
  div3.setAttribute("id", "close");
  div3.style.width ="18px";
  div3.style.height ="18px";
  div3.style.position="absolute";
  div3.style.backgroundColor="black";
  //div3.style.left="640px";
  div3.className="close";
  div3.setAttribute("onclick","close_window();");
  
  div2.appendChild(div3);
  document.getElementById("popup").appendChild(div);
  document.getElementById("popup").appendChild(div2);
  
  loadNewPage("input","/holdinwest/application/views/szkielet.html");
 }

function obrobka()
{
 var browser=navigator.appName;
 
  if (window.innerWidth || window.innerHeight){ 
  docwidth = window.innerWidth; 
  docheight = window.innerHeight; 
  } 

  if (document.body.clientWidth || document.body.clientHeight){ 
  docwidth = document.body.clientWidth; 
  docheight = window.screen.height; 
  } 
  
  div=document.createElement("div");
  div.setAttribute("id","okno");
  div.style.width=(docwidth)+"px";
  div.style.height=(docheight)+"px";
  div.style.backgroundColor="black";
  div.style.position="absolute";
  div.style.zIndex=500;
  if (browser=="Microsoft Internet Explorer")
  {
   div.style.filter = 'alpha(opacity=50)';
  }
  else
  {
  div.style.opacity=0.8;
  }
  
 
  div2=document.createElement("div");
  div2.setAttribute("id","input");
  div2.style.width="660px";
  div2.style.height="370px";
  div2.style.backgroundColor="white";
  div2.style.position="relative";
  div2.style.zIndex=501;
   if (browser=="Microsoft Internet Explorer")
  {
   div2.style.filter = 'alpha(opacity=100)';
  }
  else
  {
	div2.style.opacity=1.0;
  }
    
  div2.style.left="50%";
  div2.style.top="400px";
  
  div3 = document.createElement("div");
  div3.setAttribute("id", "close");
  div3.style.width ="18px";
  div3.style.height ="18px";
  div3.style.position="absolute";
  div3.style.backgroundColor="black";
  //div3.style.left="640px";
  div3.className="close";
  div3.setAttribute("onclick","close_window();");
  
 
  div2.appendChild(div3);
  document.getElementById("popup").appendChild(div);
  document.getElementById("popup").appendChild(div2);
  
  loadNewPage("input","/holdinwest/application/views/obrobka.html");
 }

function close_window()
{
	usun=document.getElementById("popup").removeChild(document.getElementById("okno"));
	usun=document.getElementById("popup").removeChild(document.getElementById("input"));
}
  
 function Check_Imie(obj)
 {
	if(obj.value.length>2)
	{
		var wyr = /^[a-zA-ZąęśćźżóńłĄĘÓŻŹĆŚŃŁ]+$/;
		if(wyr.test(obj.value))
		{
			imie=true;
			obj.className="green";
			check_button();
		}
		else
		{
			imie=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		imie=false;
		obj.className="white";
		check_button();
	}
}

 function Check_Nazwisko(obj)
 {
	if(obj.value.length>2)
	{
		var wyr = /^[a-zA-ZąęśćźżóńłĄĘÓŻŹĆŚŃŁ]+$/;
		if(wyr.test(obj.value))
		{
			nazwisko=true;
			obj.className="green";
			check_button();
		}
		else
		{
			nazwisko=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		nazwisko=false;
		obj.className="white";
		check_button();
	}
}

 function Check_Miasto(obj)
 {
	if(obj.value.length>2)
	{
		var wyr = /^[a-zA-ZąęśćźżółńĄĘÓŻŹĆŚŃŁ\s]+$/;
		if(wyr.test(obj.value))
		{
			miasto=true;
			obj.className="green";
			check_button();
		}
		else
		{
			miasto=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		miasto=false;
		obj.className="white";
		check_button();
	}
}

 function Check_Ulica(obj)
 {
	if(obj.value.length>2)
	{
		var wyr = /^[a-zA-ZąęśćźżóńłĄĘÓŻŹĆŚŃŁ.\s]+$/;
		if(wyr.test(obj.value))
		{
			ulica=true;
			obj.className="green";
			check_button();
		}
		else
		{
			ulica=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		ulica=false;
		obj.className="white";
		check_button();
	}
}

 function Check_Numer(obj)
 {
	if(obj.value.length>0)
	{
		var wyr = /^[0-9\/\sa-zA-Z.ąęśćźżóńłĄĘÓŻŹĆŚŃŁ]+$/;
		if(wyr.test(obj.value))
		{
			nr_mieszkania=true;
			obj.className="green";
			check_button();
		}
		else
		{
			nr_mieszkania=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		nr_mieszkania=false;
		obj.className="white";
		check_button();
	}
}

 function Check_GG(obj)
 {
	if(obj.value.length>0)
	{
		var wyr = /^[0-9]+$/;
		if(wyr.test(obj.value))
		{
			gg=true;
			obj.className="green";
			check_button();
		}
		else
		{
			gg=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		gg=true;
		obj.className="white";
		check_button();
	}
}

 function Check_Email(obj)
 {
	if(obj.value.length>6)
	{
		var wyr = /^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/;
		if(wyr.test(obj.value))
		{
			email=true;
			obj.className="green";
			check_button();
		}
		else
		{
			email=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		email=false;
		obj.className="white";
		check_button();
	}
}

 function Check_Kod(obj)
 {
	if(obj.value.length>3)
	{
		var wyr = /^[0-9]{2}-[0-9]{3}$/;
		if(wyr.test(obj.value))
		{
			kod=true;
			obj.className="green";
			check_button();
		}
		else
		{
			kod=false;
			obj.className="red";
			check_button();
		}
	}
	else
	{
		kod=false;
		obj.className="white";
		check_button();
	}
}

function check_button()
{
	if(imie&&nazwisko&&miasto&&email&&kod&&nr_mieszkania&&ulica&&gg)
		document.getElementById("button2").disabled=false;
	else
		document.getElementById("button2").disabled=true;
}

function wyslij()
{
	imie_val=document.getElementById("Imie").value;
	nazwisko_val=document.getElementById("Nazwisko").value;
	ulica_val=document.getElementById("Ulica").value;
	nr_mieszkania_val=document.getElementById("Nr_mieszkania").value;
	miasto_val=document.getElementById("Miasto").value;
	kod_pocztowy_val=document.getElementById("kod_pocztowy").value;
	email_val=document.getElementById("Email").value;
	gg_val=document.getElementById("GG").value;
	koszulka_val=document.getElementById("wybor").value;
	
	$.ajax({
		type: "POST",
		url: "zamowienie.php",
		data: "imie="+imie_val+"&nazwisko="+nazwisko_val+"&ulica="+ulica_val+"&nr_mieszkania="+nr_mieszkania_val+"&miasto="+miasto_val+"&kod_pocztowy="+kod_pocztowy_val+"&email="+email_val+"&gg="+gg_val+"&zakup="+koszulka_val,
		success: function(msg){
			alert(msg);
			remove_window();
			}
		});
}

function mouse_on(obj,id,opcja)
{
	if((id==1)&&(opcja==1))
	{
		document.img1.src="/holdinwest/application/images/layout/images_choice_10.png";
		document.left.src="/holdinwest/application/images/layout/images_choice_04.png";
	}
	if((id==2)&&(opcja==1))
	{
		document.img2.src="/holdinwest/application/images/layout/images_choice_11.png";
	}
	
	if((id==3)&&(opcja==1))
	{
		document.img3.src="/holdinwest/application/images/layout/images_choice_12.png";
	}
	
	if((id==4)&&(opcja==1))
	{
		document.img4.src="/holdinwest/application/images/layout/images_choice_13.png";
	}
	if((id==5)&&(opcja==1))
	{
		document.img5.src="/holdinwest/application/images/layout/images_choice_14.png";
	}
	if((id==6)&&(opcja==1))
	{
		document.img6.src="/holdinwest/application/images/layout/images_choice_15.png";
	}
	if((id==7)&&(opcja==1))
	{
		document.img7.src="/holdinwest/application/images/layout/images_choice_16.png";
		document.right.src="/holdinwest/application/images/layout/images_choice_17.png";
	}
}

function mouse_out(obj,id,opcja)
{
	if((id==1)&&(opcja==1))
	{
		document.img1.src="/holdinwest/application/images/layout/images_10.png";
		document.left.src="/holdinwest/application/images/layout/images_04.png";
	}
	if((id==2)&&(opcja==1))
	{
		document.img2.src="/holdinwest/application/images/layout/images_11.png";
	}
	if((id==3)&&(opcja==1))
	{
		document.img3.src="/holdinwest/application/images/layout/images_12.png";
	}
	if((id==4)&&(opcja==1))
	{
		document.img4.src="/holdinwest/application/images/layout/images_13.png";
	}
	if((id==5)&&(opcja==1))
	{
		document.img5.src="/holdinwest/application/images/layout/images_14.png";
	}
	if((id==6)&&(opcja==1))
	{
		document.img6.src="/holdinwest/application/images/layout/images_15.png";
	}
	if((id==7)&&(opcja==1))
	{
		document.img7.src="/holdinwest/application/images/layout/images_16.png";
		document.right.src="/holdinwest/application/images/layout/images_17.png";
	}
}

function switch_img(obj)
{
	if(obj.id == "szkielet")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/dom_drewno.png";
	}
	if(obj.id == "obrobka")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/obrobka_drewno.png";
	}
	if(obj.id == "mosty")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/mosty.png";
	}
	if(obj.id == "uzytecznosc")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/uzytecznosc.png";
	}
}

function switch_back_img(obj)
{
	if(obj.id == "szkielet")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/dom_drewno_normal.png";
	}
	
	if(obj.id == "obrobka")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/obrobka_drewno_normal.png";
	}
	
	if(obj.id == "mosty")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/mosty_normal.png";
	}
	if(obj.id == "uzytecznosc")
	{
		img = document.getElementById(obj.id +"_img");
		img.src = "/holdinwest/application/images/layout/uzytecznosc_normal.png";
	}
}


