function changeImages() {
	d = document;
	if (d.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (d.layers) {img = findElement(changeImages.arguments[i],0);}
			else {img = d.images[changeImages.arguments[i]];}
			if (img) {img.src = changeImages.arguments[i+1];}
		}
	}
}




function window_ecard(theURL) { //v2.0
  	myLink = "/ecard/"
	window.open(myLink + theURL,"Ecard",'width=420,height=323,left=0,top=0');
}





function window_addons(theURL) { //v2.0
myLink = "/addons/"
fenster = window.open(myLink + theURL,"Addons",'width=385,height=450,left=0,top=0,scrollbars=yes');
}


function window_user(theURL) { //v2.0
fenster = window.open("/user/" + theURL + "/","UserInfo",'width=400,height=450,left=0,top=0,scrollbars=yes');
}

function window_image(theURL) { //v2.0
myLink = "/index.php?site=image&picurl="
fenster = window.open(myLink + theURL,"Bild",'width=200,height=125,left=0,top=0,resizable=yes,scrollbars=no');
}





function window_comments(theURL) {
	remote = window.open("/comments/" + theURL,"Kommentare",'width=385,height=450,left=0,top=0,scrollbars=yes');
	if (remote.opener == null) remote.opener = window;
	remote.opener.name = "opener";
}


function ask_delete(url) {
	var answer = confirm ("Möchtest du den Eintrag wirklich löschen?")
	if (answer)
	window.location=url
}


function window_vote(theURL,theID) { //v2.0
myLink = "/index.php?site=vote&"

var strTheForm = "voteform"+theID;
vote = document.forms[strTheForm].vote.value;

window.open(myLink + theURL + "&vote=" + vote,"Vote",'width=385,height=300,left=0,top=0,scrollbars=yes');
}


currentnews = null;
function switch_hide(id_hide) {
	if (currentnews != null) {
		document.getElementById('hidediv'+currentnews).style.display = "none";
		document.getElementById('hideimg'+currentnews).src = '/images/plus.png';
	}
	document.getElementById('hidelink'+id_hide).blur();
	
	
	if (document.getElementById('hidediv'+id_hide).style.display != 'inline') {
		
		if(currentnews != id_hide){
		
			document.getElementById('hidediv'+id_hide).style.display = 'inline';
			document.getElementById('hideimg'+id_hide).src = '/images/minus.png';
   			currentnews = id_hide;
   			
		}else{
			currentnews = null;
		}
		
	} else {
		if(currentnews != id_hide){
		document.getElementById('hidediv'+id_hide).style.display = 'none';
		document.getElementById('hideimg'+id_hide).src = '/images/plus.png';
   		currentnews = id_hide;
		}else{
		document.getElementById('hidediv'+id_hide).style.display = 'none';
		document.getElementById('hideimg'+id_hide).src = '/images/plus.png';
		currentnews = null;
		}
	}
}

function style_resize() {
	if (document.getElementById('shortnews_box')) {
		tickerwidth = Math.round((document.body.offsetWidth-360)/1.7);
		document.getElementById('shortnews_box').style.width=tickerwidth+'px';
	}
	if (document.getElementById('bannertop')) {
		bannerleft = Math.round((document.body.offsetWidth-490.5)/1.1);
		document.getElementById('bannertop').style.marginLeft=bannerleft+'px';
	}
}

function mozilla_workaround() {
	if (navigator.userAgent.indexOf('Gecko') != -1) {
	    var felder = document.getElementsByTagName("input");
	    for(var i=0;i<=felder.length;i++){

	      if(felder.item(i).id=='suchbegriff'){
        felder.item(i).style.background = "url(/images/formular_bg.gif)";
        }
      }
	}
}


function go(url) { opener.location.href = url; }
