
/* Open Centered Window */
	function openWin(url, width, height,scroll) {
		var scrollbar = "";
		if (scroll == 1) {
			scrollbar = ",scrollbars=yes";
		}
		new_window=window.open(url,'new_window','width='+width+',height='+height+',toolbar=no,directories=no,location=no,status=no,menubar=no'+scrollbar+',resizable=no,screenX='+getCenterW(width)+',screenY='+getCenterH(height)+',top='+getCenterH(height)+',left='+getCenterW(width));
		new_window.focus();
	}
	function getCenterW(width) {
		return parseInt( eval( (screen.width-parseInt(width))/2 ) );
	}
	function getCenterH(height) {
		return parseInt( eval( (screen.height-parseInt(height))/2 ) );
	}
	
function loadPage(page) {
	win=window.open(page,'okynko','width=680, height=420, toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,screenX='+getCenterW(680)+',screenY='+getCenterH(420)+',top='+getCenterH(420)+',left='+getCenterW(680));
	win.focus();
}

function loadPage2(page) {
	newwin=window.open(page,'newwin','width=760, height=520, toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,screenX='+getCenterW(780)+',screenY='+getCenterH(520)+',top='+getCenterH(520)+',left='+getCenterW(780));
	newwin.focus();
}

function loadPage3(page) {
	win=window.open(page,'new','width=680, height=420, toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,screenX='+getCenterW(680)+',screenY='+getCenterH(420)+',top='+getCenterH(420)+',left='+getCenterW(680));
	win.focus();
	return false;
}

function openwin_eq(stranka) {
	WinEquipment=window.open(stranka,'WinEquipment','width=680, height=420, toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,screenX='+getCenterW(680)+',screenY='+getCenterH(420)+',top='+getCenterH(420)+',left='+getCenterW(680));
	WinEquipment.focus();
}

function loadPage_eq(stranka) {
	WinEquipment=window.open(stranka,'WinEquipment','width=680, height=420, toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,screenX='+getCenterW(680)+',screenY='+getCenterH(420)+',top='+getCenterH(420)+',left='+getCenterW(680));
	WinEquipment.focus();
	return false;
}

function back_eq()	{
	openwin_eq('/en/equipment/frames.shtml');
	loadPage2('/en/equipment/hawk_anamorphic.shtml');
	self.close();
}


/* Flash window opening */
	// Menu Array
	menu = new Array(
		['About us','/en/about',null],
		['Equipment','/en/equipment',null],
		['Credits','/en/credits',null],
		['Reservation','/en/reservation',1],
		['Contact','/en/contact',null]
	);
	
	// Quick link
	links = new Array(
		['Equipment','/en/equipment/frames.shtml',null]
	);
	
	// News Array
	news = new Array(
		['News','/en/news/index_48.shtml',null], // na stránce v pořadí 1.
		['News','/en/news/index_49.shtml',null], // na stránce v pořadí 2.
		['News','/en/news/index_50.shtml',null], // na stránce v pořadí 3.
		['News','/en/news/index_51.shtml',null] // na stránce v pořadí 4.
		);
	
	
	function openMenu(id) {
	if (menu[id-1][0] != null && menu[id-1][1] != null) {
		if (id==5) width=695;
			else width=680;
		openWin(menu[id-1][1], width, 420 , menu[id-1][2]);
	} 
	}

	function openNews(id) {
		if (id == 0) {
			openWin(news[id-1][1], 750, 520, 0);
		} else if (id == 4){
			loadPage2(news[id-1][1]);
		}
		else {
			openWin(news[id-1][1], 680, 420 , news[id-1][2]);
		} 
		
//		if (news[id-1][0] != null && news[id-1][1] != null) {
//			openWin(news[id-1][1], 680, 420 , news[id-1][2]);
//		} 
	}
	
	function openLink(id) {
		if (links[id-1][0] != null && links[id-1][1] != null) {
			window.location = links[id-1][1];
		} 
	}
	
/* Mouse Overs */
	function preload(imgSrc) {
	if (document.images) {
			eval(imgSrc+' = new Image()');
			var imsrc = imdir+"/"+imgSrc+"."+imtype;
			eval(imgSrc+'.src = "'+imsrc+'"');
		}
   }
   
   function rollit(imgName,imgObj) {
	if (document.images && imcur != imgName) {
		if (imgObj == "over") {
			imgObj=imname+imgName+"_over";
		} else {
			imgObj=imname+imgName;
		}
	imgName="im"+imgName;
			document.images[imgName].src = eval(imgObj+".src");
		}
	}

	function curr(imgName) {
	if (document.images && imcur != imgName) {
		if (clicker == 1) {
			document.images["im"+imgName].src = eval(imname+imgName+"_over.src");
				if (imcur != "im00") {
					document.images["im"+imcur].src = eval(imname+imcur+".src");
				}
				imcur=imgName;
			}
		}
		parent.frames.vt_menu.rollit(imgName);
	}

   function doPreload() {
	   for (i=imfr; i<=imto; i++) {
		  if (i < 10) {
	  		i="0"+i;
	  	}
		  preload(imname+i); preload(imname+i+"_over");
   	}
   }
   
   function newObr(src,winName,w,h,prop,lp,tp) {
	winLeft = (!lp)? (screen.width - w) / 2 : lp;
	winTop = (!tp)? ((screen.height - h) / 2) : tp;
	winProp = (!prop)? 'menubar=no,resizable=no,scrollbars=0,status=no,toolbar=no,locationbar=no,directories=no' : prop;
	winProp += ',width='+w+',height='+h+',left='+winLeft+',top='+winTop;
	Win = window.open(src,winName,winProp);
	Win.focus();
}
   
   function novy_obrazek(imgsrc,imgname,w,h) {
	//newObr('','fotos',680, 283);
	newObr('','fotos',w, h);
	Win.document.open();
	Win.document.write('<html>\n');
	Win.document.write('<head>\n');
	Win.document.write('	<title>'+imgname+'</title>\n');
	Win.document.write('	<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">\n');
	Win.document.write('<link rel="StyleSheet" href="/css/main.css" type="text/css">\n'); 
	Win.document.write('	<style type="text/css">body {margin: 0;}</style>\n');
	Win.document.write('</head>\n');
	Win.document.write('<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bottommargin="0" rightmargin="0">\n');
	Win.document.write('<img src="'+imgsrc+'" width="'+w+'" height="'+h+'" border="0" title="[click to close]" alt="[click to close]" onclick="window.close();">\n');
	Win.document.write('</body>\n');
	Win.document.write('</html>\n');
	Win.document.close();
	Win.focus();
}

