function showheader(picture)
{
	bilder=new Image();
  bilder.src="images/header/"+picture;
  
	var pic = bilder;
	var picname = picture;
  document.headerpic.src=pic.src;
  document.pageheader.pic.value=picname;
}
function showcontentpic(picture)
{
	bilder=new Image();
  bilder.src="images/content/contentpics/"+picture;
  
	var pic = bilder;
	var picname = picture;
  document.ch_cont_pic.src=pic.src;
  document.content.pic.value=picname;
}
function confirm_sendnewsletter(nlid) {
	Check = confirm('Newsletter jetzt an alle absenden ?');
	if (Check == true) {
  	self.location.href='index.php?modid=17&action=send&nlid='+nlid;
  }
}
function FLIP (id)
{
	if (document.getElementById("FLIProw_" + id).style.display == 'none')
	{
		document.getElementById("FLIPimg_" + id).src = "images/icons/iconMinus.gif";
		document.getElementById("FLIProw_" + id).style.display = "";
	}
	else
	{
		document.getElementById("FLIPimg_" + id).src = "images/icons/iconPlus.gif";
		document.getElementById("FLIProw_" + id).style.display = "none";
	}
}
function FLIPC (id)
{
	if (document.getElementById("FLIPC_" + id).style.display == 'none')
	{
		document.getElementById("FLIPC_" + id).style.display = "";		
	}
	else
	{
		document.getElementById("FLIPC_" + id).style.display = "none";
	}
}
function rollover(oTd, bgcolor) { oTd.bgColor=bgcolor; }
function rollout(oTd, bgcolor)  { oTd.bgColor=bgcolor; }

function loginswitch(target,action,text)
{
  if( action == "unset" ) {
    if( target.value == text ) {  target.value = "";  }
    target.id = "notrans";
  }
  else if( action == "set" ) {
    if( target.value == "" ) {  target.value = text;  }
    target.id = "trans";
  }
}
function popUp(URL,x,y,s) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars= '+ s +',location=0,statusbar=0,menubar=0,resizable=0,width="+ x +",height=" + y +",left = 192,top = 144');");
}

function checkTrade(answer)
{
  if (eval ("document.getElementById('trade').quantity.value.length") == 0)
  {
    alert ("How many shares would you like to buy/sell ?");
    eval ("document.getElementById('trade').quantity.focus();");
    return;
  }

	else
  {
 		Check = confirm('Really ' + document.getElementById('trade').trade_action.value+' '+document.getElementById('trade').quantity.value+' shares of "'+answer+'" ?');
		if (Check == true) 
		{
  		document.getElementById('trade').submit();
  	}
	}
}
function popUp(URL,x,y,s) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars= '+ s +',location=0,statusbar=0,menubar=0,resizable=0,width="+ x +",height=" + y +",left = 192,top = 144');");
}
function confirmDeleteFile(id) {
	Check = confirm("Really delete file?");
	if (Check == true)
  	self.location.href='index.php?modid=19&a=delfile&id='+id;
}
function confirmDeleteSubtitle(id) {
	Check = confirm("Really delete subtitle and all files?");
	if (Check == true)
  	self.location.href='index.php?modid=19&a=delsub&sid='+id;
}
function confirm_delgroup(id) {
	Check = confirm("Really delete group?");
	if (Check == true)
  	self.location.href='index.php?modid=13&action=delete&gid='+id;
}
function confirmActivateUser(user,mode,username) {
	if(mode == 1)
		var reason = "Really remove "+username+" from team-sheet?";
	else
		var reason = "Really add "+username+" to team-sheet?";
	Check = confirm(reason);
	if (Check == true)
		self.location.href='index.php?modid=3&action=activate&mode='+mode+'&userid='+user;
}