
function chgpic(name){
		document["pic_"+name]["src"]="http://www.klampfe.de/images/pointer_snow.gif";
}

function picback(name){
	document["pic_"+name]["src"]="http://www.klampfe.de/images/pointer.gif";
}




function hash2item(){
	if(window.location.hash){
		rename_var("item",window.location.hash);
		document.user.action="news.php";
		document.user.submit();
	}
}

function echo(txt){
	if(document.all){
		document.all.ienewvar.innerHTML=txt;
	}
	if(document.layers){
	document.nsnewvar.document.open();
  	document.nsnewvar.document.write(txt);
   	document.nsnewvar.document.close();
	}
}


function emulator(wappage,sid){
	requrl="http://wapdevice.imocos.com/?url=www.klampfe.de/index.php?sid=" + sid;
	popupprobs="status=no, toolbar=no, location=no, menubar=no, resizable=no, dependent=yes, width=195, height=350, screenX=0, screenY=0";
	popup=window.open(requrl,"popup",popupprobs);
	if(wappage != "" && wappage != "../" && wappage != "#" && wappage != "../#"){
		document.user.action=wappage;
		document.user.submit();
	}
	popup.focus();
}

function wappreview(url){
	requrl="http://wapdevice.imocos.com/?url=" + url;
	popupprobs="status=no, toolbar=no, location=no, menubar=no, resizable=no, dependent=yes, width=195, height=350, screenX=0, screenY=0";
	popup=window.open(requrl,"popup",popupprobs);
	popup.focus();
}


function mail2user(nid,mailto){
	document.user.method="post";
	document.user.action="../mail/action_mail.php";
	var echotxt="<input type='hidden' name='emailto' value='" + mailto + "'><input type=hidden name='emailnext' value='" + document.location.href + "'><input type=hidden name='emailaction' value='send'>";
	echo(echotxt);
	rename_var("item",nid);
	document.user.submit();
}

function gigorder(varaction,varvalue){
	rename_var("orderby",varvalue);
	document.user.action=varaction;
	document.user.submit();
}

function sendothernews(nid){
	if (document.othernews.oid.options[document.othernews.oid.selectedIndex].value != "null") {
		rename_var("oid",document.othernews.oid.options[document.othernews.oid.selectedIndex].value);
		document.user.action=document.location.href;
		document.user.submit();
	}
}

function search_submit(searchaction){
	rename_var("se",document.searching.se.value);
	document.user.action=searchaction;
	document.user.submit();
}

function rename_var(varname,varvalue){
	document.user.various.value=varvalue;
	document.user.various.name=varname;
}

function http_var(varaction,varvalue,varname){
	rename_var(varname,varvalue);
	document.user.action=varaction;
	if(document.user.action=="../include/redir.php")document.user.target="klampfe";
	document.user.submit();
}

function link2forum(thread,varvalue,varname){
	rename_var(varname,varvalue);
	document.user.thread.value=thread;
	document.user.action="../forum/new.php";
	document.user.submit();
}

function news2forum(subject){
	rename_var("f_sub",subject);
	document.user.action="../forum/new.php";
	var echotxt="<input type='hidden' name='thread' value='5'>";
	echo(echotxt);
	document.user.submit();
}

function cancel_newsletter(){
	document.user.action="../include/newsletterend.php";
	document.user.submit();
}

function empty(){
	document.new_thread.message.value='';
}

function highlight(field){
	document.register.elements[field].className='activ_form';
}

function lowlight(field){
	document.register.elements[field].className='form';
}

function bookmark() {
	if (window.external){
		external.AddFavorite(location.href, document.title)
	}else{
		alert("Ihr Browser unterstützt dieses Feature nicht!");
	}
}



function gigorder2(order,voidval){
	document.user.orderby.value=order;
	document.user.action="../music/gigs.php";
	document.user.submit();
}

function homepage(){
	window.behavior='url(#default#homepage)';
	setHomePage('http://www.klampfe.de');
}

function add_style(){
	if(document.register.newstyle.value != ""){
		alert("'" + document.register.newstyle.value + "' wird nun am Ende der Liste hinzugefügt,\nund kann danach von Ihnen ausgewählt werden.");
		newone = new Option(document.register.newstyle.value,document.register.newstyle.value);
		document.register.style.options[document.register.style.length] = newone;
		document.register.style.options[document.register.style.length-1].selected = true;
		document.register.newstyle.value = "";
		//external.AddDesktopComponent(document.location.href, website);
	}else{
		alert("Bitte den Namen Ihrer Musikrichtung eingeben!");
		document.register.newstyle.focus();
	}
}

function init(){
	init_user();
}

function init_user(){
	//if(document.user.user.value != "checked"){	
		document.user.platform.value = navigator.platform;
		if (navigator.appName!="Netscape") {
			if (navigator.cookieEnabled==true){
		     	document.user.cookies.value="yes";
			}else{
				document.user.cookies.value="no";
			}
		}else{
			document.user.cookies.value="unknown";
		}
	//}
}

function http(url,target){
	if(target!=""){
		document.user.target=target;
	}
	document.user.action=url;
	document.user.submit();
	return false;
}


function go_href(a){
	http(a,"");
	return false;
}

function httpx(url,target){
	if(target!=""){
		document.user.target=target;
	}
	document.user.action=url;
	document.user.submit();
}

function go_to (url,target){
	if(target!=""){
		popup=window.open(url,'goto','status=yes,toolbar=yes,scrollbars=yes,location=yes,menue=yes,resizable=yes,width=800,height=600');
		popup.focus();
	}else{
		document.location.href=url;
	}
}

function faq(num){
	document.user.faq.value=num;
	document.user.action=document.location.href;
	document.user.submit();
}

function forum(num){
	document.user.thread.value=num;
	document.user.action=document.location.href;
	document.user.submit();
}

function check(){
 if(document.gb.autoremail.value == ""){
   alert("Bitte eMail Adresse eintragen!");
   document.gb.autoremail.focus();
   return false;
  }
  if(document.gb.autoremail.value.indexOf('@') == -1){
   alert("Keine gültige eMail Adresse eingegeben!");
   document.gb.autoremail.focus();
   return false;
  }
  if(document.gb.autoremail.value.indexOf('.') == -1){
   alert("Keine gültige eMail Adresse eingegeben!");
   document.gb.autoremail.focus();
   return false;
  }
  if(document.gb.autor.value == ""){
   alert("Bitte Namen eintragen!");
   document.gb.autor.focus();
   return false;
  }
  if(document.gb.text.value == ""){
   alert("Bitte Text eintragen!");
   document.gb.text.focus();
   return false;
  }
}

var popup;

function popup(url){
	popup=window.open(url,'popup','status=no,toolbar=no,location=no,menue=no,resizable=no,width=101,height=101');
	//animateWindow(100,100,800,600,20,20,false);
}

function animatePopup(windowWidth,windowHeight,targetWidth,targetHeight,widthMod,heightMod,fullScreen){
	popup.focus();
	//alert(winname);
	if (fullScreen) {
		targetWidth = screen.availWidth;
		targetHeight = screen.availHeight;
	 }
	if (windowWidth < targetWidth) windowWidth += widthMod;
	if (windowHeight < targetHeight) windowHeight += heightMod;

	windowLeft = (screen.availWidth / 2) - (windowWidth / 2);
	windowTop = (screen.availHeight / 2) - (windowHeight / 2);

	popup.resizeTo(windowWidth,windowHeight);
	popup.moveTo(windowLeft,windowTop);

	if (windowWidth < targetWidth || windowHeight < targetHeight)
		setTimeout('animatePopup(' + windowWidth + ', ' + windowHeight + ', ' + targetWidth + ', ' + targetHeight + ', ' + widthMod + ', ' + heightMod + ', ' + fullScreen + ');',10);
}

function close_popup(){
	window.close();
}

function animateWindow(windowWidth,windowHeight,targetWidth,targetHeight,widthMod,heightMod,fullScreen){

	if (fullScreen){
		targetWidth = screen.availWidth;
		targetHeight = screen.availHeight;
	 }

	if (windowWidth < targetWidth) windowWidth += widthMod;
	if (windowHeight < targetHeight) windowHeight += heightMod;

	windowLeft = (screen.availWidth / 2) - (windowWidth / 2);
	windowTop = (screen.availHeight / 2) - (windowHeight / 2);

	top.window.resizeTo(windowWidth,windowHeight);
	top.window.moveTo(windowLeft,windowTop);

	if (windowWidth < targetWidth || windowHeight < targetHeight){
		setTimeout('animateWindow(' + windowWidth + ', ' + windowHeight + ', ' + targetWidth + ', ' + targetHeight + ', ' + widthMod + ', ' + heightMod + ', ' + fullScreen + ');',10);
	}else{
		setTimeout('close_popup()',2000);
	}
 }