/* copyright   RomanticRoad e.K.  all rights reserved.  Title:  JS For All Language Pages   */

var topPos =  0;
var options = "menubar=no,resizeable=no,scrollbars=yes,status=no";
var scrw = 1024;
var pfont = 15;
var dxwin = 620; 
var leftPos = 177;
var winPost = null;
var winTwo = null;
var winThree = null;
var winFour = null;
var randnum = 1;
var stdBrowser = true;

/* navroll function parameters for img button sizes  */
var hotelw  = 43;  var  hotelh = 25;
var roomw  = 49;  var  roomh = 25;
var restw  = 79;   var resth = 23;
var cellarw  = 46; var cellarh = 36;
var mapw  = 33;  var maph = 25;
var homew = 45; var homeh = 25;


/*  romanticroad and external links  rrlink() and rrlinkex() [plus partners]  */

function rrlink(hreftxt,visibletxt,classname)
{
	// used when no partner websites are planned 
	var copyrt = "&copy; RomanticRoad e.K.";
	document.write("<p class='" + classname + "'><a  href='" + hreftxt +  "'>" + visibletxt +  "</a><br /></p>");
	document.write("<p class='" + classname + "'><a href='http://www.romanticroad.com/copyright'>" + copyrt + "</a></p>");
}

function initrrlinks()
{
			if (document.getElementById)
			 {
				partnersObj = document.getElementById("partners").style;
			}
			else 
			{
				partnersObj = document.partners;
			}
			partnersObj.visibility = "hidden";
}
function exlinksShow() 
{ 
	partnersObj.visibility="visible";
} 

function exlinksHide() 
{ 
	partnersObj.visibility="hidden";
}

function rrlinkex(hreftxt,visibletxt,classname)
{
	// with partner websites text button
	var copyrt = "&copy; RomanticRoad e.K.";
	document.write("<table class='" + classname + "'  border='0'  cellpadding='0'  cellspacing='0'><tr>"); 
	document.write("<td align='center'  valign='top'><p class='" + classname + "'><a href='javascript:exlinksHide()'  " +
	"onMouseOver='javascript:exlinksShow()' >Partner Websites</a></p></td>");
	document.write("<td align='center' valign='top'><p class='" + classname + "'><a href='" + hreftxt +  "'>" + visibletxt +  "</a></p></td>");
	document.write("<td align='center' valign='top'><p class='" + classname + "'><a href='http://www.romanticroad.com/copyright'>" + copyrt + 		"</a></p></td></tr></table>");
	
}


function logoinfo(classname)
{
	var imgname = "../images/logo2.jpg";
	var imgw = Math.floor(250 * scrw / 1024)
	var imgh = Math.floor(137 * scrw / 1024)
	document.write("<p class='" + classname + "' ><img" + 
	" src='" + imgname + "'  width='" + imgw + "' height='" + imgh + "' border='0' " +
	" name='logo'  alt='Logo'  class='" + classname + "' /><br /><br />");
	document.write("<em>Vital </em><b>Hotel Sommer</b><br />Famillie Wolfgang Sommer <br />Weidachstraße 74<br />D-87629 Füssen<br />" + 
	"Tel: 08362-91470<br />Fax: 08362-914714<br /><a href='mailto:info@hotel-sommer.de'>info@hotel-sommer.de" +
	"</a><br />www.romanticroad.com/hotel-sommer<br />_______</p>");
} 


function popWin(url)
{
	closeTwo();
	winTwo = window.open(url,"Menu","width=" + dxwin + ",height=" + dywin + ",left=" + leftPos + ",top=" + topPos + options); 
}

function closeTwo()
{
	if ((winTwo) && (!winTwo.closed))
	{
		winTwo.close();
	}
}

function closeThree()
{
	if ((winThree) && (!winThree.closed))
	{
		winThree.close();
	}
}

/*  Manage  Images  With JS  */

function adaptImg(pathname,imgwidth,imgheight,classname)
{
	var imgw = Math.floor(imgwidth * scrw / 1024)
	var imgh = Math.floor(imgheight * scrw / 1024)
	document.write("<img src='" + pathname + "'  width='" + imgw + "' height='" + imgh + "' border='0'  class='" + classname + "' />");
}

function imggif(filepath,imgwidth,imgheight,classname)
{
	var imgw = Math.floor(imgwidth * scrw / 1024)
	var imgh = Math.floor(imgheight * scrw / 1024)
	var gifname = filepath + scrw + ".gif";
	document.write("<img src='" + gifname + "'    width='" + imgw + "'    height='" + imgh + "'  border='0'   class='" + classname + "' />");

}

function imgglass(imgwidth,imgheight)
{
	var gifname = "images/glass.gif";
	var imgw = Math.floor(imgwidth * scrw / 1024)
	var imgh = Math.floor(imgheight * scrw / 1024)
	document.write("<img src='" + gifname + "'  width='" + imgw + "' height='" + imgh + "' border='0'  />");
}

/*  Manage Tags with Style   */

function chgstyleID(idname,xpos, ypos)
{
	var posx =  Math.floor(xpos * scrw / 1024);
	var posy =  Math.floor(ypos * scrw / 1024);
	document.write("<style type='text/css'>#" + idname + " {position: absolute; top:" + posy + "px;  left:" + posx + "px;}</style>");  
} 

function adaptAbsPos(tagdotclass,tagleft,tagtop)
{
	var tagl = Math.floor(tagleft  * scrw / 1024);
	var tagt = Math.floor(tagtop  * scrw / 1024);
	document.write("<style type='text/css'>" + tagdotclass +  "{position: absolute;}</style>");    
	document.write("<style type='text/css'>" + tagdotclass +  "{left:" + tagl + "px;}</style>");    
	document.write("<style type='text/css'>" + tagdotclass +  "{top:" + tagt + "px;}</style>");    
}

function adaptTxtTag(tagdotclass,txtwidth,dfontsz)
{
	var paraw =  Math.floor(txtwidth * scrw / 1024);
	var fontsz = pfont + dfontsz;
	document.write("<style type='text/css'>" + tagdotclass +  "{font-size:" + fontsz + "px;}</style>");  
	document.write("<style type='text/css'>" + tagdotclass +  "{width:" + paraw + "px;}</style>");      
}

function adaptTxtSize(tagdotclass,dfontsz)
{
	var fontsz = pfont + dfontsz;
	document.write("<style type='text/css'>" + tagdotclass +  "{font-size:" + fontsz + "px;}</style>");  
}

function adaptLinkColor(tagdotclass,fontcolor)
{
	document.write("<style type='text/css'>" + tagdotclass +  ":link {color:" + fontcolor + ";text-decoration: none;}</style>");  
	document.write("<style type='text/css'>" + tagdotclass +  ":visited {color:" + fontcolor + ";text-decoration: none;}</style>");  
	document.write("<style type='text/css'>" + tagdotclass +  ":hover {color: red;text-decoration: none;}</style>");  
}


function adaptWidth(tagdotclass,tagwidth)
{
	var tagw = Math.floor(tagwidth  * scrw / 1024);
	document.write("<style type='text/css'>" + tagdotclass +  " {width:" + tagw + "px;}</style>");    
}

function adaptSize(tagdotclass,tagwidth,tagheight)
{
	var tagw = Math.floor(tagwidth  * scrw / 1024);
	var tagh = Math.floor(tagheight  * scrw / 1024);
	document.write("<style type='text/css'>" + tagdotclass +  "{width:" + tagw + "px;}</style>");    
	document.write("<style type='text/css'>" + tagdotclass +  "{height:" + tagh + "px;}</style>");    
}

function adaptBG(tagdotclass,bgfilename)
{
	var imgbg =  bgfilename;
	document.write("<style type='text/css'>" + tagdotclass + "  {background-image:url(" + imgbg + ");}</style>");    
}

/*
function adaptBG(tagdotclass,imgpath)
{
	var imgbg =  imgpath + scrw + ".jpg";
	document.write("<style type='text/css'>" + tagdotclass + "  {background-image:url(" + imgbg + ");}</style>");    
}
*/

function adaptPos(tagdotclass,tagleft,tagtop)
{
	var tagl = Math.floor(tagleft  * scrw / 1024);
	var tagt = Math.floor(tagtop  * scrw / 1024);
	document.write("<style type='text/css'>" + tagdotclass +  " {left:" + tagl + "px;}</style>");    
	document.write("<style type='text/css'>" + tagdotclass +  " {top:" + tagt + "px;}</style>");    
}

/*  Main Program Code  */ 

var dxscreen = screen.width;
var dyscreen = screen.height;
var dywin = dyscreen - 55;

	if ( dxscreen < 950 )
	{
		scrw = 800;
		pfont = 11;
		dxwin = 484; 
	}
	else
	{
		if ( dxscreen <  1100 )
		{
			scrw = 1024;
			pfont = 15;
			dxwin = 620; 
		}
		else
		{	
			if ( dxscreen < 1250 )
			{
				scrw = 1152;
				pfont = 17;
				dxwin = 698; 
			}
			else
			{
				scrw = 1280;
				pfont = 18;
				dxwin = 775; 
				if ( dyscreen < 900 )
				{
					scrw = 1024;
					pfont = 15;
					dxwin = 620; 
				}
			}
		}
	}
leftPos =  (dxscreen / 2) - (dxwin / 2 + 15);

/* End Main  */