/* 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;

function navroll(pgname,linkname,classname,altlabel)
{
	var bnpgname = "images/" + pgname + scrw +  ".gif";
	var bnpgnameh = "images/" + pgname +  "h" + 1024 + ".gif"; 
	var bnlabel = altlabel;
	var pghtm = linkname; 
	if (pgname == "hotel")  { var imgwidth = hotelw; var imgheight = hotelh; };
	if (pgname == "room")  { var imgwidth = roomw; var imgheight = roomh; };
 	if (pgname == "rest")   { var imgwidth = restw; var imgheight = resth; };
	if (pgname == "cellar") { var imgwidth = cellarw; var imgheight = cellarh; };
 	if (pgname == "map")   { var imgwidth = mapw; var imgheight = maph; };
	if (pgname == "home") { var imgwidth = homew; var imgheight = homeh; };
	var imgw = Math.floor(imgwidth  * scrw / 1024);
	var imgh = Math.floor(imgheight * scrw / 1024);
	var tagn = pgname + "name";
	if (linkname == "h")
	{
		
		document.write("<p class='nav'><img src='" + bnpgnameh + "'  border='0'   width='"  + imgw + "'   height='"  + imgh + "'   "  +
		" name='" + tagn + "'  alt='" + bnlabel + "'  class='" + classname + "' /></p>"); 
	}
	else
	{
	
	document.write("<p class='nav'><a href='" + pghtm +  "'  onMouseOver='document." + tagn + ".src=\"" + bnpgnameh + "\"'  " + 
	"onMouseOut='document." + tagn + ".src=\"" + bnpgname + "\"'  >" +
	"<img src='" + bnpgname + "'  border='0'   width='"  + imgw + "'   height='"  + imgh + "'  "  +
	" name='" + tagn + "'  alt='" + bnlabel + "'  class='" + classname + "' /></a></p>"); 
	}
}

function logoinfo(classname)
{
	var imgname = "../images/logo" + scrw + ".gif";
	var imgw = Math.floor(175 * scrw / 1024)
	var imgh = Math.floor(106 * scrw / 1024)
	document.write("<br /><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/<br />hotel-sommer<br />_______</p>");
} 

function contactinfo(classname)
{
	document.write("<br /><p class='" + classname + "' ><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/<br />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 jpgname = "../images/" + pgname + ".jpg";
	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 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 adaptBG2(tagdotclass,bgrootname)
{
	var imgbg =  bgrootname + scrw + ".jpg";
	document.write("<style type='text/css'>" + tagdotclass + "  {background-image:url(" + imgbg + ");}</style>");   
	// document.write("<style type='text/css'>" + tagdotclass + "  {background-repeat: repeat-x;}</style>");    
	// document.write("<style type='text/css'>" + tagdotclass + "  {background-color:rgb(240,238,249);}</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  */