var ver = 0;
var mainString;
	  // images preload
	  var imageCount = 0;
      imageObj = new Image();
      images = new Array();
      // realizacie
      images[0] = "mudron";
      images[1] = "samorin";
      images[2] = "vub";
      images[3] = "kopernica";
      images[4] = "lucky";
      images[5] = "hodzovo";
      images[6] = "ev_nitra";
      images[7] = "dlhediely";
      images[8] = "nbs";
      images[9] = "teplicka";
      images[10] = "byt";
      images[11] = "jt";
      images[12] = "podkrovie";
      images[13] = "irb";
      images[14] = "nabytok";
      images[15] = "rdslov";
      images[16] = "unilever";
      images[17] = "drhotel";
      images[18] = "domkol";
      images[19] = "cac";
      images[20] = "metropol";
      images[21] = "rdmh";
      images[22] = "cacbb";
      images[23] = "domde";
      images[24] = "awt";
      images[25] = "trnavska";
      images[26] = "raca";
      images[27] = "ruzinov";
      images[28] = "klzava";
      images[29] = "az";
      images[30] = "vlckova";
      images[31] = "slsp";
      images[32] = "podhradie";
      images[33] = "coop";
      images[34] = "mvila";
      images[35] = "staromestska";
      images[36] = "zahbystrica";
	  images[37] = "tatracity";
	  images[38] = "ska";
	  images[39] = "domde2";
       for(imageCount=0; imageCount<=39; imageCount++) {
       	imageURL = "http://www.zavodny.sk/images/" + images[imageCount] + "/preview.jpg";
         imageObj.src = imageURL;
         }
         
function showSubMenu(object) {
	mainString = document.all[object].style.left;
	numString = mainString.substring(0,mainString.length-2);
	mainWidth = (document.body.clientWidth - 700)/2;
	if (mainWidth < 0) mainWidth = 0;
	leftWidth = 1*numString + 1*mainWidth;
	setWidth = leftWidth + "px";
	document.all[object].style.left = setWidth;
	if (document.getElementById && document.getElementById(object) != null)
	node = document.getElementById(object).style.display='inline';
	else if (document.layers && document.layers[object] != null)
	document.layers[object].display = 'inline';
	else if (document.all)
	document.all[object].style.display = 'inline';
}

function hideSubMenu(object) {
	if (document.getElementById && document.getElementById(object) != null)
	node = document.getElementById(object).style.display='none';
	else if (document.layers && document.layers[object] != null)
	document.layers[object].display = 'none';
	else if (document.all)
	document.all[object].style.display = 'none';
	document.all[object].style.left = mainString;
}

function openDWF(drawing) {
	options = "resizable,width=720,height=560";
	windowName = "WinDWF" + Math.round(100000*Math.random());
	opener = window.open('',windowName,options);
	opener.document.open();
	opener.document.write('<html><head><title>..::DWF::..</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"></head><body topmargin="0" leftmargin="0" scroll="no">');
	opener.document.write('<object id="viewer" classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" codebase="http://www.autodesk.com/global/dwfviewer/installer/DwfViewerSetup.cab" ');
	opener.document.write('width="100%" height="100%"><param name="src" value="'+ drawing +'"><param name="PaperVisible" value="false"><br><b>Váš prehliadač nepodporuje zobrazenie DWF objektov!<br><br>Your browser do not support DWF object!</b></object></body></html>');
	opener.document.close();
}

function showGoogleMaps(location,language){
	document.write('<a href="http://maps.google.com/maps?q=' + location + '&hl=' + language + '" target="_blank"><img valign="top" align="right" src="images\\googlemaps.png" border="0" title="');
	if (language != "en") document.write('Pozrite si tento objekt na');
		else document.write('Look this building at');
	document.write(' Google Maps..."></a>');
}

function showPreview(imageName){ 
		document.all.preview.src = "images/" + imageName + "/preview.jpg";
		document.all.preview.width = "120";
		document.all.preview.style.display = "inline";
}

function hidePreview(){ 
		document.all.preview.src = "images/blank.gif";
		document.all.preview.width = "0";
		document.all.preview.style.display = "none";
}

function showThumb(imageName){ 
		document.all.thumb.src = "images/" + imageName + "/preview.jpg";
		document.all.thumb.width = "120";
		document.all.thumb.style.display = "inline";
}

function hideThumb(){ 
		document.all.thumb.src = "images/blank.gif";
		document.all.thumb.width = "0";
		document.all.thumb.style.display = "none";
}