// *** Procs for www.royalkandersteg.com ***
// (c) CreativeZone (http://www.cz-site.com | mailto:contact@cz-site.com)
// All Rights Reserved.


function SiteContextMenu(){
	alert("(c) Royal Park Hotel, Kandersteg");
}

function SetbHTML(b){
	top.bHTML=b;
}
function GetbHTML(){
	if (top.bHTML!=null) return top.bHTML;
	return top.bHTML=(s=window.location.search).substr(s.lastIndexOf("bHTML")+6,1);
}

function SetLangID(LangID,bOnSite){
	top.LangID=LangID;
	if (bOnSite) {
		top.Menu.window.location="Frame_Menu.htm";
		LoadContent(top.ContentName);
	} else top.window.location="FrameSet.htm?LangID="+LangID+"&bHTML="+GetbHTML();
}
function GetLangID(){
	if (top.LangID!=null) return top.LangID;
	return top.LangID=(s=window.location.search).substr(s.lastIndexOf("LangID")+7,2);
}


function LoadContent(name){
	top.ContentName=name;
	top.Content.window.location="cont_"+name+"_"+GetLangID()+".htm";
}
function LoadContentByURL(url){
	top.Content.window.location=url;
}

function Hook_WinResize(){
	Events.GetDocSize();
}

function WriteStatusBar(minW, minH, ds){
	var maxRC=8, s="";
	Events.GetDocSize();
	if (Events.DocW<minW || Events.DocH<minH) {
		if (top.window.gRC==null || top.window.gRC>=maxRC*2) top.window.gRC=0;
		if (++top.window.gRC<maxRC) s=""; else s="*** ENLARGE THE WINDOW PLEASE! ***      --->>>";
	} else { s=ds; top.window.gRC=null; }
	top.window.status=s;
}

function InitPageFrame() {
	Events.Initialize();
	Add_ContextMenu("SiteContextMenu()"); 
}

function InitPageContent() {
	Events.Initialize();
	//Add_ContextMenu("SiteContextMenu()");
	setInterval("WriteStatusBar(589, 310, 'Royal Park Hotel, Kandersteg')",50);
}

function PutTitle(text,ruText) {
	if (GetbHTML()==0) document.write(Flash.GetHTML("Title","Media/Title.swf?LangID="+GetLangID()+"&Text="+(GetLangID()=="RU"?text:escape(text)),500,30,"#fafafa",true));
	else document.write('<font class="Title">'+(GetLangID()=="RU"?ruText:text)+'</font>');
}
function PutSubMenuItem(text,cmd) {
	//document.write(Flash.GetHTML("SubMenuItem","Media/SubMenuItem.swf?Text="+escape(text)+"&Command="+escape("LoadContent('"+cmd+"')"),300,16,"#fafafa"));
	document.write('<img src="Media/ArrowLink.gif" border="0" alt="">&nbsp;&nbsp;<a href="javascript:LoadContent(\''+cmd+'\')" class="SubMenuL">'+text+'</a>');
}
function PutSubMenuLink(text,url) {
	document.write('<img src="Media/ArrowLink.gif" border="0" alt="">&nbsp;&nbsp;<a href="'+url+'" target="_blank" class="SubMenuL">'+text+'</a>');
}
function PutButtonBack(cmd) {
	switch (GetLangID()) {
		case "EN" : text="BACK"; break;
		case "DE" : text="ZÜRUCK"; break;
		case "FR" : text="RETOUR"; break;
		case "RU" : text="ÍÀÇÀÄ"; break;
		case "IT" : text="INDIETRO"; break;
		case "ES" : text="RETROCEDER"; break;
		default   : text="BACK";
	}
	if (GetbHTML()==0) document.write(Flash.GetHTML("ButtonBack","Media/ButtonBack.swf?LangID="+GetLangID()+"&Command="+escape("LoadContent('"+cmd+"')"),74,16,"#ffffff"));
	else document.write('<input type="button" value="  '+text+'  "  class="cmdButtonNS" onclick="LoadContent(\''+cmd+'\')">');
}

