﻿/* copyright  2002-2005 RomanticRoad e.K.  all rights reserved.  Title:  JS For All Language Pages   */

var scrw = 1024 ;
var pfont = 15;
var english;
var englishh;
var deutsch;
var deutschh;
var greeteObj;
var greetdObj;
var greetbgObj;
var randlast = 0;
var stdBrowser; 

var popwinw  =  800;
var topPos =  0;
var options = "menubar=yes,resizeable=no,scrollbars=yes,status=no";
var dxwin = 620; 
var leftPos = 0;
var winPost = null;
var winTwo = null;

var engw  = 75; var engh = 25; 
var deuw  = 75; var deuh = 25; 
var japw  = 75; var japh = 25; 
var chiw  = 79; var chih = 25;
var itaw  = 70; var itah = 18;
// var englang =  new Image();    englang.src  = "images/englishlh1024.gif";
// var deutlang = new Image();    deutlang.src = "images/deutschlh1024.gif";
// var japanlang  = new Image(); japanlang.src= "images/japanlh1024.gif";

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 == "englishl") { var imgwidth = engw; var imgheight = engh; };
	if (pgname == "deutschl"){ var imgwidth = deuw; var imgheight = deuh; };
 	if (pgname == "japanl")    { var imgwidth = japw; var imgheight = japh; };
	if (pgname == "chinal")    { var imgwidth = chiw; var imgheight = chih; };
	if (pgname == "italianol")    { var imgwidth = itaw; var imgheight = itah; };

	var imgw = Math.floor(imgwidth  * scrw / 1024);
	var imgh = Math.floor(imgheight * scrw / 1024);
	
	if (linkname == "h")
	{
		
		document.write("<img src='" + bnpgnameh + "'  border='0'   width='"  + imgw + "'   height='"  + imgh + "'   "  +
		"name='" + pgname + "' alt='" + bnlabel + "'  class='" + classname + "' />"); 
	}
	else
	{
	
	document.write("<a href='" + pghtm +  "'  onMouseOver='document." + pgname + ".src=\"" + bnpgnameh + "\"'" + 
	"onMouseOut='document." + pgname + ".src=\"" + bnpgname + "\"'  >" +
	"<img src='" + bnpgname + "'  border='0'   width='"  + imgw + "'   height='"  + imgh + "'  "  +
	"name='" + pgname + "' alt='" + bnlabel + "'  class='" + classname + "' /></a>"); 
	}
}


function rrlink(hreftxt,visibletxt,classname)
{
	var copyrt = "&copy; RomanticRoad e.K.";
	document.write("<p class='" + classname + "'><a  href='" + hreftxt +  "'>" + visibletxt +  "</a><br /><br />"  +
	"<a href='http://www.romanticroad.eu/copyright'>" + copyrt + "</a></p>");
}



/*  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,classname,imgwidth,imgheight)
{
	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 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 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 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 adaptBGs(tagdotclass,imgpath)
{
	var imgbg =  imgpath + scrw + ".jpg";
	document.write("<style type='text/css'>" + tagdotclass + "  {background-image:url(" + imgbg + ");}</style>");    
}


/*   popup window for partner pages   */

function popWin(url)
{
	closeTwo();
	winTwo = window.open(url,"Menu","width=" + popwinw + ",height=" + dywin + ",left=" + leftPos + ",top=" + topPos + options); 
}

function closeTwo()
{
	if ((winTwo) && (!winTwo.closed))
	{
		winTwo.close();
	}
}

/*   popup window for impressum page   */
function popWin2(url)
{
	closeTwo();
	winTwo = window.open(url,"Menu","width=" + dxwin + ",height=" + dywin + ",left=" + leftPos + ",top=" + topPos + options); 
}

/*  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 < 950)
				{
					scrw = 1152;
					pfont = 17;
					dxwin = 698; 
				}
				if (dyscreen < 850)
				{
					scrw = 1024;
					pfont = 15;
					dxwin = 620; 
				}
			}
		}
	}
popwinw = Math.floor( 0.80 * dxscreen);
leftPos =  (dxscreen / 2) - (popwinw / 2 + 15);
/*
english = new Image;english.src = "images/english" + scrw + ".gif";
englishh = new Image;englishh.src = "images/englishh" + 1024 + ".gif"; 
deutsch = new Image;deutsch.src = "images/deutsch" + scrw + ".gif"; 
deutschh = new Image;deutschh.src = "images/deutschh" + 1024 + ".gif"; 
italiano = new Image;italiano.src = "images/italiano" + scrw + ".gif"; 
italianoh = new Image;italianoh.src = "images/italianoh" + 1024 + ".gif"; 
*/

/* End Main  */