<!--
//********************************************************************************

var old;
var memold;
var block_layer = 0;
var actual_section;
var pic_dir = '/pics/';

if(document.layers) {
	window.captureEvents(Event.MOUSEUP);
	window.onmouseup=subnav_off;
	/*
	window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown=subnav_off;
	*/
	} 
else {
	document.onmouseup=subnav_off;
	// document.onmousedown=subnav_off;
	}

//********************************************************************************


function HelpWin(page, sid) {
	newWin = window.open('/hilfe/index.php4?sid='+sid+'&page='+page,'helpwin','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,dependent=no,width=600,height=400');
	newWin.creator = self;
	}


//********************************************************************************

var timeStr, dateStr;

function init_vars(year, month, day, hour, minute, second, as, pd) {
	server = new Date(year,month,day,hour,minute,second);
	client = new Date();
	delta = server.getTime() - client.getTime();

	actual_section = as;
	pic_dir = pd;
	}


//********************************************************************************

function clock() {
	now = new Date();
	now_server = now.getTime() + delta;
	now.setTime(now_server);
	
	//time
	hours = now.getHours();
	minutes = now.getMinutes();
	seconds = now.getSeconds();
	timeStr = '' + hours;
	timeStr += ((minutes<10) ? ':0' : ':') + minutes;
	timeStr += ((seconds<10) ? ':0' : ':') + seconds;
	
	window.status="dieZehnGebote.de Serverzeit: " + timeStr + " Uhr";
	
	Timer=setTimeout("clock()",1000);
	}


//********************************************************************************


function openUploadWin(url) {
	newWin = window.open(url,'upload_win','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=300,height=400');
	newWin.creator = self;
	newWin.focus();
	}
		

//********************************************************************************


function openInfoWin(url) {
	newWin = window.open(url,'upload_win','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=350,height=200');
	newWin.creator = self;
	newWin.focus();
	}
		

//********************************************************************************

function openChatWin(url, name) {
	newWin = window.open(url,'chat_win_' + name,'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,width=500,height=500');
	newWin.creator = self;
	newWin.focus();
	}


//********************************************************************************

function updateForm(val,sid,type) {

	if (!opener) {
		if (val != '') {
			if (type == 'auction') {
				creator.document.auction.elements['form[pic_url]'].value = val;
				creator.document.auction.sid.value = sid;
				}
			else if (type == 'news') {
				creator.document.news.elements['form[pic_url]'].value = val;
				creator.document.news.sid.value = sid;
				}
			else if (type == 'username') {
				creator.document.message.elements['form[recipient_list]'].value += (creator.document.message.elements['form[recipient_list]'].value != '') ? ',' : '';
				creator.document.message.elements['form[recipient_list]'].value += val;
				creator.document.message.sid.value = sid;
				}
			else {
				creator.document.profile.elements['form[profile_pic_url]'].value = val;
				creator.document.profile.sid.value = sid;
				}
			}
		}
	else {  
		if (val != '') {
			if (type == 'auction') {
				opener.document.auction.elements['form[pic_url]'].value = val;
				opener.document.auction.sid.value = sid;
				}
			else if (type == 'news') {
				opener.document.news.elements['form[pic_url]'].value = val;
				opener.document.news.sid.value = sid;
				}
			else if (type == 'username') {
				opener.document.message.elements['form[recipient_list]'].value += (creator.document.message.elements['form[recipient_list]'].value != '') ? ',' : '';
				opener.document.message.elements['form[recipient_list]'].value += val;
				opener.document.message.sid.value = sid;
				}
			else {
				opener.document.profile.elements['form[profile_pic_url]'].value = val;
				opener.document.profile.sid.value = sid;
				}			
			}
		}
	window.close(self);
	}


//********************************************************************************


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}


//********************************************************************************


function MM_showHideLayers() { //v3.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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


//********************************************************************************


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//********************************************************************************


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//********************************************************************************


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}


//********************************************************************************


function check_subnav(x) {
	if (!old) {
		MM_showHideLayers('sektion0' + x, '', 'show');
		change_reiter(x);
		old=x;
		}
	else if(old!=x) {
		MM_swapImgRestore();
		MM_showHideLayers('sektion0' + old, '', 'hide');
		MM_showHideLayers('sektion0' + x, '', 'show');
		change_reiter(x);
		old=x;
        }
	}


//********************************************************************************


function change_reiter(x) {
	if (actual_section != x)
		MM_swapImage('pic_main_nav_0' + x, '', pic_dir + 'main_nav_0' + x + 'on.gif', 
					 'pic_main_nav_0' + actual_section, '', pic_dir + 'main_nav_0' + actual_section + 'off.gif');
	else MM_swapImage('pic_main_nav_0' + x, '', pic_dir + 'main_nav_0' + x + 'on.gif');
	}
	

//********************************************************************************

	
function subnav_off() {
	if (!block_layer) { // Layer ist durch Click auf Link gesperrt
		if(old) {
			MM_showHideLayers('sektion0' + old, '', 'hide');
			MM_swapImgRestore();
			}
		memold = old;
		old='';
		}
	else block_layer=0; // Layer wieder zum Ausschalten freigeben
	}


//********************************************************************************


function do_block_layer() {
	block_layer = 1;
	}

//********************************************************************************
	

MM_reloadPage(true);


//********************************************************************************

function select_auction(form_name) {
	for(i=0;i<document.forms[form_name].elements.length;i++) {
		thiselm = document.forms[form_name].elements[i];
		if(thiselm.name.substring(0,13) == 'form[auction_')
			thiselm.checked = !thiselm.checked
		}
	}

//********************************************************************************

function select_rating_queue(form_name) {
	for(i=0;i<document.forms[form_name].elements.length;i++) {
		thiselm = document.forms[form_name].elements[i];
		if(thiselm.name.substring(0,18) == 'form[rating_queue_')
			thiselm.checked = !thiselm.checked
		}
	}

//********************************************************************************


function popunder(size, sid) {
	size_x = (size == 'big') ? 600 : 300;
	size_y = (size == 'big') ? 400 : 600;
	neu=window.open('/misc/show_ad.php4?size=' + size + '&sid=' + sid, 'popunder','screenX=50,screenY=100,scrollbars=no,toolbar=no,directories=no,status=no,menubar=no,resizable=no,width=' + size_x + ',height=' + size_y);
	neu.blur();
	}

//********************************************************************************


//-->
