// Javascript-Funktionen für die Webseite des VC Austria
// Das ist ein Include-File, der von fast allen HTML-Files der Site angesprochen wird

function SetCookie (name, value) 
{
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}

function get_cookie(Name) 
{
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    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;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function click() 
{
if (event.button==2)
	{
//x=window.showModalDialog("http://www.vcw.at/introfiles/copyright.htm",null,"dialogWidth:330px;dialogHeight:360px");
alert("© by Vespa Club Austria");
	}
}
document.onmousedown=click// -->



/*
Die Funktion show_pic zeigt das mit bildnam.jpg angegebene Bild in seiner natürlichen Größe an.
Wird im Parameter bt ein Bildtext angegeben (kann auch weggelassen werden), so wird dieser zentriert unter dem Bild angezeigt.
Rechter Mausklick auf das große Bild zeigt einen Copyright-Hinweis.
Aufruf: <img title="Zum Vergrößern anklicken!" onclick="show_pic('grossbild.jpg','Bildtext')" 
src="kleinbild.jpg" width="100" height="66" hspace="5" border="0" align="left">
*/
var newwin;
function show_pic(bildnam,bt)
{
einst='toolbar=no ,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no';
if (newwin == undefined || newwin.closed)
{
	newwin=window.open("","mywin",einst);
	newwin.document.write('<head><title>Vespa-Club Austria</title><META HTTP-EQUIV="imagetoolbar" CONTENT="no"></head>');
	newwin.resizeTo(700,525);
	newwin.moveTo(0,0);
	newwin.document.write('<DIV ID="meldung" STYLE="position:relative;z-index:5;top:100;left:center" align="center"><strong><font color="#FF0000" face="Arial, Helvetica, sans-serif">Bild wird geladen ....</font></strong></DIV>');
	zarg=show_pic.arguments.length;
	newwin.document.write('<div id="div1" style="position:absolute; left:0; top:0;"><img name="mypic" style="z-index:-1" src="'+bildnam+'"></div>');
	if(zarg>1)		//mit Bildtext
		{
		do
			{
			w=newwin.mypic.width;
			h=newwin.mypic.height+60;
			ht=h-10;
			}
		while(newwin.mypic.complete==false);
		w=newwin.mypic.width;
		h=newwin.mypic.height+60;
		ht=newwin.mypic.height-10;
		
		x=window.screen.availHeight;
		y=window.screen.availWidth;
		verh=x/h;
		if(h>x)
			{
			h=x;
			newwin.mypic.height=x-60;
			ht=newwin.mypic.height-10;
			w=w*verh;
			newwin.mypic.width=w;
			}
		}
	else		//kein Bildtext
		{
		bt="";
		do
			{
			w=newwin.mypic.width;
			h=newwin.mypic.height+35; // + Höhe der Titelzeile!
			}
		while(newwin.mypic.complete==false);
		w=newwin.mypic.width;
		h=newwin.mypic.height+35; // + Höhe der Titelzeile!
		ht=h+5;
		
		x=window.screen.availHeight;
		y=window.screen.availWidth;
		verh=x/h;
		if(h>x)
			{
			h=x;
			newwin.mypic.height=x-35;
			w=w*verh;
			newwin.mypic.width=w;
			}
			
		}
	newwin.resizeTo(w,h);
	newwin.moveTo(0,0);
	newwin.document.all["meldung"].style.display = "none";
	newwin.document.write('<p><font color="#666666" size="2" face="Arial, Helvetica, sans-serif"><div align="center" id="mytxt" style="position:relative; left:center;top:'+ht+'px">'+bt+'</div></font></p>');
	}
else		//Fenster schon offen 
{
	newwin.mypic.src=bildnam;
	zarg=show_pic.arguments.length;
	if(zarg>1)		//mit Bildtext
		{
		do
			{
			w=newwin.mypic.width;
			h=newwin.mypic.height+60;
			ht=newwin.mypic.height-10;
			}
		while(newwin.mypic.complete==false);
		w=newwin.mypic.width;
		h=newwin.mypic.height+60;
		ht=newwin.mypic.height-10;
		}
	else		//kein Bildtext
		{
		bt="";
		do
			{
			w=newwin.mypic.width;
			h=newwin.mypic.height+35; // + Höhe der Titelzeile!
			ht=h+5
			}
		while(newwin.mypic.complete==false);
		w=newwin.mypic.width;
		h=newwin.mypic.height+35; // + Höhe der Titelzeile!
		ht=h+5
		}
	newwin.resizeTo(w,h);
	newwin.moveTo(0,0);
	newwin.document.all["meldung"].style.display = "none";
	newwin.mytxt.innerText=bt;
	newwin.document.all.mytxt.style.pixelTop=ht;
	newwin.focus();
	}
	newwin.onclick=newwin.execScript('function click() {if (event.button==2) alert("© by Vespa Club Austria");} document.onmousedown=click','JavaScript');
}		// end function SHOW_PIC