stats = true;

function bgc(color){
 document.bgColor = color;
}
 
function displayImageOld(id,imagename,title,x,y) 
{
       
	if (navigator.appName == "Netscape" ) {
	  y = y + 3;
	  x = x + 3;
  	}	

        myWin = window.open("","window" + id, "Width=" + x + ",Height=" + y + ",screenX=25,screenY=25,scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no"); 
	// open document for further output 
	myWin.document.open(); 
	myWin.document.writeln('<html><head><title>' + title ); 
	myWin.document.writeln('</title>');
	myWin.document.writeln('</head>');
	myWin.document.writeln('<frameset rows="100%,*" border="0" frameborder="0" framespacing="0">');
	myWin.document.writeln('<frame src=' + imagename + ' scrolling="none" marginheight="0" marginwidth="0">');
	myWin.document.writeln('</frameset>');
	myWin.document.writeln('</html>'); 

	// close the document - (not the window!) 
	myWin.document.close(); 
	myWin.focus();
} 

function openWindow(id,url,title,x,y) 
{ 
	if (navigator.appName == "Netscape" ) {
	  y = y + 3;
	  x = x + 3;
  	}	
   	myWin= window.open(url,"window" + id, "Width=" + x + ",Height=" + y + ",screenX=25,screenY=25,scrollbars=yes,status=no,toolbar=no,menubar=no,resizable=no"); 
	
}

function displayImage(id,imagename,title,x,y) 
{
       
	if (navigator.appName == "Netscape" ) {
	  y = y + 3;
	  x = x + 3;
  	}	

    myWin = window.open("","window" + id, "Width=" + x + ",Height=" + y + ",screenX=25,screenY=25,scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no"); 
	// open document for further output 
	myWin.document.open(); 
	myWin.document.writeln('<html><head>');
	myWin.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
	myWin.document.writeln('<meta name="GENERATOR" content="Microsoft FrontPage 6.0">');
	myWin.document.writeln('<title>'+ title + '</title>');
	myWin.document.writeln('</head>'); 
	myWin.document.writeln('<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" >');
	if (stats) {
		myImage = new Image(1,1);
		myImage.src = imagename;
		myWin.document.writeln(imgstats(myImage.src));
	}	 
	myWin.document.writeln('<div style="position: absolute; left: 0px; top: 0px; z-index:1; width:10px; height:10px; background-color:#FFFFFF">');
	myWin.document.writeln('<img src="' + imagename + '"  marginheight="0" marginwidth="0" name="image1">');
	myWin.document.writeln('</div>');
	myWin.document.writeln('</body></html>');


	// close the document - (not the window!) 
	myWin.document.close(); 
	myWin.focus();
} 

function displayFlash(id,flashname,title,x,y) 
{ 
	if (navigator.appName == "Netscape" ) 
	{
	  yheight = y + 3;
	  xwidth = x + 3;
  	}	
	else
	{
	  yheight = y + 0; 
	  xwidth = x + 0;
  	}	

   	myWin= open("","window" + id, "Width=" + xwidth + ",Height=" + yheight + ",screenX=25,screenY=25,scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no"); 
	// open document for further output 
	myWin.document.open(); 
	myWin.document.write('<html><head><title>' + title ); 
	myWin.document.write('</title></head><body topmargin="0" leftmargin="0"> \n');
	myWin.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \n');
	myWin.document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" \n');
	myWin.document.write('WIDTH='+ x + ' HEIGHT=' + y + '> \n');
	myWin.document.write('<param name="_cx" value="14552"> \n');
	myWin.document.write('<param name="_cy" value="9260"> \n');
  	myWin.document.write('<PARAM NAME="movie" VALUE="' + flashname + '"> \n');
  	myWin.document.write('<param name="Src" value="' + flashname + '"> \n');
  	myWin.document.write('<param name="WMode" value="Window"> \n');
  	myWin.document.write('<param name="Play" value="-1"> \n');
  	myWin.document.write('<param name="Loop" value="0"> \n');
  	myWin.document.write('<param name="Quality" value="High"> \n');
  	myWin.document.write('<param name="SAlign" value="LT"> \n');
  	myWin.document.write('<param name="Menu" value="-1"> \n');
  	myWin.document.write('<param name="Base" value> \n');
  	myWin.document.write('<param name="Scale" value="ShowAll"> \n');
  	myWin.document.write('<param name="DeviceFont" value="0"> \n');
  	myWin.document.write('<param name="EmbedMovie" value="0"> \n');
  	myWin.document.write('<param name="BGColor" value="FFFFFF"> \n');
  	myWin.document.write('<param name="SWRemote" value><embed src="' + flashname + '" loop="false" quality="high" salign="LT" bgcolor="#FFFFFF" WIDTH="550" HEIGHT="300" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> \n');
	myWin.document.write('</object>');

	myWin.document.write('</body></html>'); 

	// close the document - (not the window!) 
	myWin.document.close(); 
//	mywin.focus();
}

function mystats() 
{
	
 	output_line = create_stats_record(document.URL);

	if (stats) {
		d.write(output_line);	
	}	
	d.close();

}
function imgstats(image_name) 
{

 	return create_stats_record(image_name);
}

function create_stats_record(source_url) 
{
	d=document;
    n=navigator;	
	s=screen;
	var today = new Date();
	var expires = new Date();

	n.appName!="Netscape"? srb=s.colorDepth:srb=s.pixelDepth;
	referer_string = escape(parent.parent.document.referrer);
	referer_string = referer_string.substr(0,255);
	browser_version = escape(n.appVersion);
	browser_version = browser_version.replace(";","%3B");
	source_url = escape(source_url);
	if (navigator.userAgent.toLowerCase().indexOf('chrome') !=-1) browser = "Chrome"; 
	else
		if (navigator.userAgent.toLowerCase().indexOf("safari")!=-1) browser = "Safari";
		else
			if (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1) browser = "Firefox";
			else	
				if (navigator.userAgent.toLowerCase().indexOf("opera")!=-1) browser = "Opera";
				else
					if (navigator.appName == "Netscape") browser = "Netscape";
					else
					  	if (navigator.appName == "Konqueror") browser = "Konqueror";
					  	else
					  		if (self.opera) browser = "Opera";
					  		else
					  			if (document.all) browser = "Microsoft Internet Explorer";
					   			else 
						 			browser = "Other";
		 
//	expires.setTime(today.getTime() + 1000*60*60*24);
//	uniqueid = getCookie("identifier");
//	if (uniqueid == null) {
//		uniqueidtemp = today.getTime();
//		setCookie("identifier", uniqueidtemp, expires);
//		uniqueid = getCookie("identifier");
//	}
  	output_line = '<img src="'+siteid()+'?'+referer_string+';'+
		screen.width+';'+screen.height+";"+browser+";"+browser_version+";"+n.language+";"+n.platform+";"+source_url+';'+srb+';\r\n'+'" height=1 width=1 >'

	return output_line;
}
// Sets cookie values. Expiration date is optional
//
function jansetCookie(name, value, expire) {
	document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}
// gets cookie values. 
//
function jangetCookie(Name) {
	var search = Name + "=";
	if (document.cookie.length > 0) { // if there are any cookies
		offset = document.cookie.indexOf(search);
		if (offset != -1) { // if cookie exists
			offset += search.length;
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset);
			// set index of end of cookie value
			if (end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(offset, end));
		}
	}
}
function gethorizontalpos(nValue){
		return isIE ? nValue : nValue;
}
function getverticalpos(nValue){
		if (navigator.appName == "Konqueror") return nValue - 70;
		if (isOp) return nValue +19;
		if (isIE) return nValue + 19;
		return nValue + 15;
}

function detect_mobile_device() 
{
	d=document;
    n=navigator;
    if (n.platform == "WinCE" || n.platform == "iPhone" || n.platform == "iPod" || n.platform == "PSP" ||
    	n.platform.substring(1,9) == "Nintendo" || n.platform == "Pike v7." || n.platform.substring(1,12) == "PLAYSTATION" ||
    	n.platform == "Windows Mobile" || navigator.userAgent.indexOf("Android") > -1)
	{
	    d.write("\"<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=http://www.hotel-stadt-wien.com/mobile\"  /> ");    
	}  
	
}

// --> 
