/* 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;

/*
function randjpg(basename,numimg,imgwidth,imgheight,classname,altlabel)
{
	randnum = Math.ceil(Math.random() * numimg);
	var jpgname = "../images/" + basename +  randnum + ".jpg";
	var imgw = Math.floor(imgwidth * scrw / 1024)
	var imgh = Math.floor(imgheight * scrw / 1024)
	var bnlabel = altlabel;
	var tagname = basename;
	document.write("<img src='" + jpgname + "'  width='" + imgw +  "'  height='" + imgh +  "'  border='0' " +
	"name='" + tagname + "' alt='" + bnlabel + "'  class='" + classname + "' />");
}

function bkmarkroll(imgone,imgtwo,bkmark,imgwidth,imgheight,classname,altlabel)
{
	var pgname = "bk" + bkmark;
	var bnpgname = imgone.src;
	var bnpgnameh = imgtwo.src; 
	var imgw = Math.floor(imgwidth * scrw / 1024)
	var imgh = Math.floor(imgheight * scrw / 1024)
	var pghtm = "#" + bkmark; 
	var bnlabel = altlabel;
	document.write("<a href='" + pghtm +  "'  onMouseOver='document." + pgname + ".src=\"" + bnpgnameh + "\"'" + 
	"onMouseOut='document." + pgname + ".src=\"" + bnpgname + "\"'  >" +
	"<img src='" + bnpgname + "'  width='" + imgw + "' height='" + imgh + "' border='0' " +
	"name='" + pgname + "' alt='" + bnlabel + "'  class='" + classname + "' /></a>"); 
}

*/

function popWin(url)
{
	// special window
	var dxwina =  Math.floor(400 * scrw / 1024);
	var topPos = 0;
	var leftPos = dxscreen - 2*dxwina -20;
	closeTwo();
	winTwo = window.open(url,"Menu","width=" + dxwina + ",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,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 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,imgpath)
{
	var imgbg =  imgpath + scrw + ".jpg";
	document.write("<style type='text/css'>" + tagdotclass + "  {background-image:url(" + imgbg + ");}</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 < 950)
				{
					scrw = 1152;
					pfont = 17;
					dxwin = 698; 
				}
				if (dyscreen < 850)
				{
					scrw = 1024;
					pfont = 15;
					dxwin = 620; 
				}
			}
		}
	}


leftPos =  (dxscreen / 2) - (dxwin / 2 + 15);

/* End Main  */
