function loginswitch(target,action,text)
{
  if( action == "hide" ) {
    if( target.value == text ) {  target.value = "";  }
    target.id = "noswitch";
  }
  else if( action == "set" ) {
    if( target.value == "" ) {  target.value = text;  }
    target.id = "switch";
  }
}
function FLIP (id,id2)
{
	if (document.getElementById("FLIP_" + id).style.display == 'none')
	{
		document.getElementById("FLIP_" + id).style.display = "";
		document.getElementById("FLIP_" + id2).style.display = "none";
	}
	else
	{
		document.getElementById("FLIP_" + id).style.display = "none";
		document.getElementById("FLIP_" + id2).style.display = "";
	}
}

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=1,resizable=0,width="+ x +",height=" + y +",left = 192,top = 144');");
}
function MM_confirm(msg, url) { //v1.0
  if(confirm(msg)) location.replace(url);
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function confirmDeleteNews(id) {
	Check = confirm("Really delete news?");
	if (Check == true)
  	self.location.href='index.php?modid=8&a=delnews&id='+id;
}
function confirmActivateNews(id,mode) {
	if(mode == 0)
		var reason = "Unrelease news?";
	else
		var reason = "Release news?";
	Check = confirm(reason);
	if (Check == true)
		self.location.href='index.php?modid=8&a=activatenews&mode='+mode+'&id='+id;
}
function changeSquadpic(count,squadname,color) {
	bilder=new Image();
	bilder.src="scripts/usernames/fontgen.php?color="+ color +"&str1="+squadname;
	var pic = bilder;
	document.getElementById("squadpic" + count).src=pic.src;
}
function changeUserpic(count,str1,str2,str3,color) {
	bilder=new Image();
	bilder.src="scripts/usernames/fontgen.php?color="+ color +"&str1="+str1+"&str2="+str2+"&str3="+str3;
	var pic = bilder;
	document.getElementById("userpic" + count).src=pic.src;
}