function tabbar(action,hl) {
document.form.jsaction.value = action;
document.form.newhl.value = hl;
document.form.submit();
}

function formchanged ()
	{
	document.form.form_changed.value = 'yes';
	}
function LinkSet(element) {previouslink = element.href;}
function LinkConvert(element,action,button)
		{	
		if (action != '') {script = 'javascript:ActionSubmit(\'' + action + '\')'; }
			else {script = 'FormSubmit()';}
			if (document.forms[0].k.value < 16 || document.forms[0].k.value > 17) 
				// alert(button);
				{if ((button < 2 && (navigator.userAgent.toLowerCase().indexOf('msie')!=-1 || navigator.userAgent.toLowerCase().indexOf('avant')!=-1)) || (button < 1 && navigator.userAgent.toLowerCase().indexOf('msie')==-1) || (button = 1 && navigator.userAgent.toLowerCase().indexOf('safari')!= -1)|| (button = 0 && navigator.userAgent.toLowerCase().indexOf('chrome')!= -1))
					{document.forms[0].action = element.href;
					element.href='javascript:' + script;
					window.status= element;}
				}
		}
function linkclear(element) {
	window.status='';
	innerContent = element.innerHTML; //quickfix for IE
	element.href = previouslink;
	element.innerHTML = innerContent; //quickfix for IE with @ in the title
	document.forms[0].action = requesthandler;
}

// Set Focus on the first field that contains an error
function errfocus (fieldname)
		{
		document.forms[0].elements[fieldname].focus();
		}

// Rückfrage (Ja,Nein) auslösen, Aktion zwischenspeichern

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=10}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function help(destination,win_name,win_dim) 
	{
			window.open (destination ,win_name,win_dim + ',' + 'resizable=yes,scrollbars=yes,toolbar=no,Left=250,Top=250,status=no,directories=no,menubar=no,location=tabelle');
 	}

function ChangedConfirmSubmit(action,message)
	{
	confirmtype = "2";
	if (document.form.form_changed.value == 'yes' && message != '')
		{
		nextaction = action;
		openQuestion("Yes,No,Cancel",message);
		}
	else
		{
		ActionSubmit(action);
		}
	}
	
function ConfirmSubmit(action,message) 
{
	if (confirm(message) == true)
	  {
	  ActionSubmit(action);
	  }
}
function ParameterSubmit(action) 
{
	var crit = event.srcElement.options[event.srcElement.selectedIndex].value;
	document.forms[0].action = document.forms[0].action + '?crit=' + crit + "&" + parameter;
	ActionSubmit(action);
}

function CategorySelect()
	{
		var categoryID = event.srcElement.options[event.srcElement.selectedIndex].value;
		action = 'act_auctions_list_categories:ca=' + categoryID;
		if (categoryID > 0) {
			document.forms[0].action = 'kategorie.cfm?ca=' + categoryID;
			ActionSubmit(action);
	}
}

// zeigt ein Rückfragefenster
//   unter buttons wird eine Liste erwartet, die die Buttons bilden soll
//	 unter msg die Nachricht, die auf dem Fenster gezeigt werden soll */
function openQuestion(buttons,msg)
{
  Fenster = window.open("dsp_confirm.cfm?buttons=" + buttons + "&msg=" + msg,"Frage","width=250,height=120,resizable=no");
	Fenster.moveTo(screen.width / 2 - 125, screen.height / 2 - 60);
}


	
// Nimmt die Antwort aus dem Rückfragefenster entgegen
function getanswer(answer)
{
  switch(confirmtype + "=" + answer)
	{
	  case "1=Yes":
		  ActionSubmit(nextaction);
			break;
		case "1=No":
			break;
		case "2=Yes":
		  ActionSubmit("2" + nextaction);
			break;
		case "2=No":
		  ActionSubmit(nextaction);
		case "2=Cancel":
		break;
	}
}

function linkclear() {
		window.status='';
		document.forms[0].action = requesthandler;
		}
		
// Aktion über URL-Variable verschicken.
	function ActionSubmit(action) {
		document.forms[0].jsaction.value = action;
		document.forms[0].submit();
	}
function FormSubmit(action) {
		document.forms[0].submit();
	}

function formsubmit(action,message) {
	if (message != '')
		{if (confirm (message) == true)
			{
			document.forms[0].action = document.forms[0].action + "?action=" + action;
			document.forms[0].submit();
			}
		}
	else
		{
		document.forms[0].action = document.forms[0].action + "?action=" + action;
		document.forms[0].submit();
		}
}

	<!-- begin to hide script contents from old browsers
	function checksearch()
	  {
		var searchlen = document.forms[0].searchterm.value;
		if(searchlen == "")
			{
			alert("Bitte geben Sie einen Suchbegriff ein!");
			}
		else {
				ActionSubmit('act_products_search');
			 }
	  }
	// end hiding script from old browsers -->



	function popitup(destination,win_name,win_dim) 
	{
			window.open (destination ,win_name,win_dim + ',' + 'resizable=no,scrollbars=no,toolbar=no,Left=250,Top=250,status=no,directories=no,menubar=no,location=tabelle');
 	}



	if (document.layers) document.captureEvents(Event.KEYPRESS); 
	// needed if you wish to cancel the key

	function kexhandler(e) {
	    if (document.layers)
	        Key = e.which;
	    else
	        Key = window.event.keyCode;
			
//        alert("Key pressed! ASCII-value: " + Key);

	    if (Key == 13){
			var searchlen = document.forms[0].searchterm.value;
			if(searchlen == "")
				{
				alert("Bitte geben Sie einen Suchbegriff ein!");
			    if (document.layers)
					return false;
		    	else
					window.event.returnValue = false;
				}
			else {
					ActionSubmit('act_auctions_search');
				 }
			}
	}

function calc_pot(a,b,c,e,g){
		var fehler = false;
		document.forms[0].msg_voraussetzung.value="";
		
		
		var d = document.forms[0].zeitpunkt.value;
		var d = d.replace(/,/,".");
		
		if(d == ""){
			document.forms[0].msg_zeitpunkt.value = "Bitte einen Betrag eingeben.";
			var fehler = true;
		}
		else if(isNaN(d) == true){
			document.forms[0].msg_zeitpunkt.value = "Bitte nur Betraege eingeben.";
			var fehler = true;
		}
		else if(d.indexOf(".")!=-1&&(d.indexOf(".")>d.length-3||d.indexOf(".")<d.length-3)){
			document.forms[0].msg_zeitpunkt.value = "Bitte nur richtige Betraege eingeben.";
			var fehler = true;
		}
		else if(parseFloat(d)>e){
			document.forms[0].msg_zeitpunkt.value = "Der Preis muss kleiner als der aktuelle Preis sein.";
			var fehler = true;
		}
	
		if(fehler==false){
			var spanne = a-b;
			var spanne2 = a-parseFloat(d);
			var laufzeit = c*24*60*60*1000;
			var laufzeit2 = Math.round((laufzeit/spanne)*spanne2);
			var Jahr = parseInt(g.substr(0,4));
			if(parseInt(g.substr(5,2))==0){var Monat = parseInt(g.substr(6,1))-1;}else{var Monat = parseInt(g.substr(5,2))-1;}
			if(parseInt(g.substr(8,2))==0){var Tag = parseInt(g.substr(9,1));}else{var Tag = parseInt(g.substr(8,2));}
			if(parseInt(g.substr(11,2))==0){var Stunden = parseInt(g.substr(12,1));}else{var Stunden = parseInt(g.substr(11,2));}
			if(parseInt(g.substr(14,2))==0){var Minuten = parseInt(g.substr(15,1));}else{var Minuten = parseInt(g.substr(14,2));}
			if(parseInt(g.substr(17,2))==0){var Sekunden = parseInt(g.substr(18,1));}else{var Sekunden = parseInt(g.substr(17,2));}
			var heute = new Date(Jahr,Monat,Tag,Stunden,Minuten,Sekunden);
			var heute_time = heute.getTime();
			var dann_time = heute_time + laufzeit2;
			heute.setTime(dann_time);
			var wochentag = heute.getDay();
			if(wochentag==0){f="Sonntag";}
			else if(wochentag==1){f="Montag";}
			else if(wochentag==2){f="Dienstag";}
			else if(wochentag==3){f="Mittwoch";}
			else if(wochentag==4){f="Donnerstag";}
			else if(wochentag==5){f="Freitag";}
			else if(wochentag==6){f="Samstag";}
			
			var tag = heute.getDate();
			var monat = heute.getMonth()+1;
			var jahr = heute.getYear();
			var std = heute.getHours();
			var minu = heute.getMinutes();
			var sek = heute.getSeconds();
			var tagausgabe  = ((tag < 10) ? "0" + tag : tag);
			var monatausgabe  = ((monat < 10) ? "0" + monat : monat);
			var stdausgabe  = ((std < 10) ? "0" + std : std);
			var minuausgabe  = ((minu < 10) ? "0" + minu : minu);
			var sekausgabe  = ((sek < 10) ? "0" + sek : sek);
			document.forms[0].msg_zeitpunkt.value="Der Preis ist erreicht am "+f+", den "+tagausgabe+"."+monatausgabe+"."+jahr+" um "+stdausgabe+":"+minuausgabe+" Uhr und "+sekausgabe+" Sekunden.";
			document.forms[0].msg_voraussetzung.value="Voraussetzung ist hierbei, dass der Preis bis zum angegebenen Preis faellt.";		
		}
	}


