function set_startseite ( c_hp )
{
	var URL="http://www.augsburger-marktplatz.de";
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 
	{
		c_hp.style.behavior='url(#default#homepage)';
		c_hp.setHomePage(URL);
	}
	else
	{
	    var startseitepopup = window.open('','startseite','width=329,height=300,screenX=100,screenY=100');
		startseitepopup.document.write('<html><head><title>Browser-Information</title><link rel="STYLESHEET" type="text/css" href="/style.css"></head><body class="popup">Dieser Browsertyp unterstützt diese Aktion nicht!<br>Bitte wählen Sie daher unter Menu Einstellung und tragen dort die Startseite ein!</body></html>');
	}
}
function add_favorite (  )
{
	var URL="http://www.augsburger-marktplatz.de";
	var Titel="Augsburger Marktplatz";
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 
	{
		window.external.AddFavorite(URL,Titel);
	}
	else
	{
	    var startseitepopup = window.open('','startseite','width=329,height=300,screenX=100,screenY=100');
		startseitepopup.document.write("<html><head><title>Browser-Information</title><link rel=\"STYLESHEET\" type=\"text/css\" href=\"/style.css\"></head><body>Bitte <Strg>+D drücken</body></html>");
	}
}
function ch_wbanner (img_src)
{
	img_src.src="/wbanner.php";
	setTimeout("ch_wbanner(img_src)", 6000);
}
function checkPraesenzort( formular )
   {
	if(window.document.forms[formular].kursnummer.value=="-----")
	    {
		alert("Bitte wählen Sie einen gültigen Präsenzort!");
		window.document.forms[formular].kursnummer.focus();
		return false;
		}
	  return true;
    }
  
function checkOnlineForm()
  {
  if(window.document.form1.name.value=="" || window.document.form1.strasse.value=="" || window.document.form1.port.value=="" || window.document.form1.plz.value==""  )
	    {
		alert("Bitte geben Sie wenigstens Name, Strasse, PLZ und Ort an!");
		window.document.form1.name.focus();
		return false;
		}
  
  if((window.document.form1.elements[17].checked == true) && (window.document.form1.firma.value=="" || window.document.form1.fistrasse.value=="" || window.document.form1.fiort.value=="" || window.document.form1.fiplz.value=="") )
	   {
	   alert("Sie haben als Rechnungsempfänger eine Firma angegeben, bitte füllen Sie die Anschrift Ihrer Firma aus!");
	   window.document.form1.plz.focus();
	   return false;
	   }
		
  if(window.document.form1.AGB.checked == false)
       {
		alert("Akzeptieren Sie bitte die Teilnahmebedingungen");
		window.document.form1.AGB.focus();
		return false;
	   }
  return true;
  }
  
function printOut()
  {
  window.print();
  }

function chooseTown( parameter )
  {
  doc="auswahl.php" + parameter;
  win=window.open(doc,"auswahl","width=750,height=450,menubar=no ");
  }
  
function submitImageWorkarround( index )
  {
  if (index == 2)
     window.document.form1.via.value="Faxanmeldung";
  else
     window.document.form1.via.value="Onlineanmeldung";
  
  }

function checkit( )
   {
  // alert ("Entered checkit");
	if(window.document.forms[0].kursnummer.value=="-----")
	    {
		alert("Bitte wählen Sie einen gültigen Präsenzort!");
		window.document.forms[0].kursnummer.focus();
		return false;
		}
	  return true;
    }
  
/*
  author: Andreas Deschka
  email: andreas.deschka@sol.at
  sample-url: http://193.170.245.144/~andreasdeschka/linkInfo_sample.html
  Browsers: IE6,Mozilla,Opera
  Sample:
  in your header:
	<script language="javascript">
	infoSettings={	infoElementBGColor:"#FF00FF",infoElementTextColor:"#FF0000" };
	// creates new Object to pass variables, if there is no object or no variables are passed, default values are used.
	</script>
	<script language="javascript" src="linkInfo2.js"></script>
	
  within text in your body:
	 <a href='http://google.at' info='click here for a good search engine<br>new window'>Link</a>
*/

// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page
infoElement= null; // node of the Div-Layer that shows the information
xFromMouse=0;
yFromMouse=0;
yUpFromMouse=10;
turnOver=false;
standardStyle='position:absolute;left:0px;top:0px;visibility:hidden;text-align:center;z-index:999;';
nav= new Object();
vars=new Object();
vars.tags=[ 'a' ]; // array of tag-names that should provide information
vars.infoAttributeName= 'info'; // in the tags the attribute that contains the text to show	
vars.infoElementCentered= true; // centered relative to mouse-pointer
vars.infoElementId=null; // use this div-Tag for the id to show information, null->create new one
vars.infoElementStyleClass=null; // use this CSS-class if no Id is defined, do not forget padding	
vars.infoElementFontSize= '12px'; // use if no Id and no CSS-class is defined
vars.infoElementTextColor='#000000';
vars.infoElementBGColor= '#FFFFE1';// // use if no Id and no CSS-class is definded
function setVariables(){
	var settings= window.infoSettings;
	// infoSettings is optional object that contains user variables
	// insert infoSettings before adding link to this js-file
	if( settings==null ){
		// default values are used		
	} else {
	    for( var varName in settings ){
	    	if( settings[varName]!=null )
	    		vars[varName]= settings[varName];	
	    }
	}	
};
setVariables();	
begin();
function begin(){	
	attachInfoElement();
	installTagListeners();
	captureFunction= function(){};	
	
	if (document.getElementById && window.innerWidth ) {
		// Netcsape 6 + Mozilla + Opera
		yFromMouse=21;
		xFromMouse=4;
		captureFunction = captureMouse_NS;
		if (navigator.userAgent.indexOf("Opera")>-1){
			nav.op= true;				
		} else {
			nav.nn= true;	
		}		
	} else if (document.all) {
		// Internet Explorer
		nav.ie= true;
		yFromMouse=17;
		xFromMouse=2;
		captureFunction = captureMouse_IE_body;
		if ( document.documentElement&& document.documentElement.clientWidth>0 ){
			captureFunction = captureMouse_IE_documentElement;
		}			    	
	}  
	oldOnMouseMove= document.onmousemove;
	document.onmousemove=function(e){
		if( oldOnMouseMove!=null ){		
			oldOnMouseMove(e);
		}
		captureFunction(e);
		out('y'+yMousePos+'ym'+yMousePosMax+' ');
		moveInfoElement();
	}	
}
function captureMouse_IE_documentElement(){			
	xMousePos = window.event.x+ document.documentElement.scrollLeft; 
        yMousePos = window.event.y+document.documentElement.scrollTop;
        xMousePosMax = document.documentElement.clientWidth+document.documentElement.scrollLeft;
        yMousePosMax = document.documentElement.clientHeight+document.documentElement.scrollTop-12;   	
}
function captureMouse_IE_body(){
	xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
}
function captureMouse_NS(e){
	xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
}
function out( string ){
	var outDiv=document.getElementById('out')
	if(outDiv!=null) outDiv.firstChild.nodeValue+=string+"\n";
}
function attachInfoElement( ){
	var str='<div style="'+standardStyle+'" id="';
	if(vars.infoElementId!=null &&vars.infoElementId.length>0){
		str+= vars.infoElementId+'" ';		
	} else {
		vars.infoElementId='infoElement';
		str+= vars.infoElementId+'"';	
		if(vars.infoElementStyleClass!=null && vars.infoElementStyleClass.length>0){
			str+= ' class="'+vars.infoElementStyleClass+'" ';			
		} else {
			str+=' class="'+vars.infoElementId+'" ';
			var sty='<style type="text/css"><!--';
			sty+=('#'+vars.infoElementId+' {');
			sty+=('background-color: '+vars.infoElementBGColor+';');	
			sty+='color:'+vars.infoElementTextColor+';';
			sty+=('border: 1px solid #999999;');
			sty+=('font-size: '+vars.infoElementFontSize+';');
			sty+=('font-family: Arial, Helvetica, sans-serif;');
			sty+='padding:2px;';
			sty+=('}	--></style>');			
			document.writeln( sty );
		}
	}	
	str+=' >&nbsp;</div>'	
	out(str);
	document.writeln( str );	
}
function installTagListeners( delayTime ){
	infoElement=document.getElementById( vars.infoElementId );
	if( infoElement==null ){} else {		
		for( var k=0; k<vars.tags.length; k++){		
			var links=document.getElementsByTagName(  vars.tags[k].toUpperCase() );
			for(var i=0;links!=null&&i<links.length;i++){				
				var node= links[i];
				var infoText=node.getAttribute( vars.infoAttributeName ); 
				if( infoText!=null && infoText.length > 0&& node.infoText_==null ){
						node.infoText_= infoText;
						// the _ is used to avoid name conflicts with the attributes of the user
						node.style.cursor='pointer';
						if( node.onmouseover==null ){
							node.onmouseover= showInfo;					
						} else {
							node.oldOnmouseover= node.onmouseover;
							node.newOnmouseover= showInfo;
							node.onmouseover= function(){
								this.newOnmouseover();
								this.oldOnmouseover();
							}
						}
						if( node.onmouseout==null ){
							node.onmouseout= hideInfo;					
						} else {
							node.oldOnmouseout= node.onmouseout;
							node.newOnmouseout= hideInfo;
							node.onmouseout= function(){
								this.newOnmouseout();
								this.oldOnmouseout();
							}
					   }
				}
			}
		}
	}	
	if( delayTime==null)
		delayTime=0;
	if( delayTime < 2 ){
		delayTime+=0.2;
	}	
	setTimeout('installTagListeners('+delayTime+')',delayTime*1000); 
}
function moveInfoElement( setTurnOver ){	
	// setTurnOver: decide only once if position should be above or beneath mouse to prevent jerking	
	if( infoElement ==null ){
		//out('infoElement=null ');
		//alert('infoElement=null');
		//infoElement=1;
	} else if( infoElement.style.visibility != 'hidden'){		
		var x,y;
		x=xFromMouse+xMousePos;
		if(vars.infoElementCentered==true){
			x-=0.5*infoElement.offsetWidth;			
		}		
		if( xMousePosMax>0 && x+ infoElement.offsetWidth> xMousePosMax-20 ){
			x= xMousePosMax-20- infoElement.offsetWidth;			
		}
		if( x<5 ){
			x=5;
		}		
		if( nav.op==true ){
			y= yMousePos - yUpFromMouse - infoElement.offsetHeight;	
			if( setTurnOver==true ){
				turnOver= ( y < 5 );
			}
			if( turnOver==true ){
				y= yFromMouse+yMousePos+12;	
			}
		} else {
			y= yFromMouse+yMousePos;		
			if( setTurnOver==true ){
				turnOver= (yMousePosMax>0 && y+ infoElement.offsetHeight> yMousePosMax);
			}
			if( turnOver==true ){
				y= yMousePos - yUpFromMouse - infoElement.offsetHeight;	
			}
		}		
		infoElement.style.left=x+'px'; 
		infoElement.style.top=y+'px';		
	} 
}
function setInfoText( text ){			
	var subtext='';
	for(var i=0;i<text.length;++i){		
		if(text.substr(i,4)=='<br>'){			
			infoElement.appendChild(document.createTextNode(subtext));
			infoElement.appendChild(document.createElement('br'));
			subtext='';
			i+=3;
		} else {
			subtext=subtext+text.charAt(i)
		}
	}	
	infoElement.appendChild( document.createTextNode(subtext));		
}
function unsetInfoText(){
	while(infoElement.hasChildNodes()){
		infoElement.removeChild(infoElement.lastChild);
	}	
}
function showInfo(){
	unsetInfoText();
	infoElement.left='0px';
	infoElement.top='0px';
	setInfoText( this.infoText_ );		
	infoElement.style.visibility='visible';
	moveInfoElement( true );				
}
function hideInfo(){		
	infoElement.style.visibility='hidden';
	unsetInfoText();	
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function tryPrint() {
      window.print();
      window.close();
 }
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

