function picviewer (nameOfTheFile, widthOfTheFile, heightOfTheFile) {
	window.open("php/pic.php?" + nameOfTheFile, 'Picture-Viewer', "width=" + widthOfTheFile + ",height=" + heightOfTheFile + ",scrollbars,resizable=yes");
}

function checkAll (is_checked) {
	for (i=0;i<document.getElementsByName("pms_action[]").length;i++) {
	document.getElementsByName("pms_action[]")[i].checked = is_checked;
	}
}

function gotothat (msg, gotothis) {
	if (confirm(msg)) {
		self.location.href = gotothis;
	}
}

function finduser (defaultLang) {
	window.opener = this;
	window.open("finduser.php?lang="+defaultLang, '', "width=250,height=150,scrollbars=yes,statusbar=yes,resizable=no");
}

function swapOver (theFile) {
	document.dl.dl_file.value = theFile;
}

function mehrNews (id) {
	if (document.getElementById("AusklappFeld_" + id).style.display == 'none')
	{
		document.getElementById("PlusMinus_" + id).src = "images/minusc.gif";
		document.getElementById("AusklappFeld_" + id).style.display = "";
	}
	else
	{
		document.getElementById("PlusMinus_" + id).src = "images/plusc.gif";
		document.getElementById("AusklappFeld_" + id).style.display = "none";
	}
}

function printAlert (textToDo) {
	self.alert(textToDo);
}

function popThisUp (arg1, arg2, arg3) {
	window.open(arg1, arg2, arg3);	
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function clock() {

//ZEIT
  var now = new Date();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds(); 

  if(hours<10){
    hours = "0"+hours;
  }
  if(minutes<10){
    minutes = "0"+minutes;
  }
  if(seconds<10){
    seconds = "0"+seconds;
  }
  
  var timeString = ""+hours+":"+minutes+":"+seconds;
  uhr.innerHTML = timeString;

//DATUM
  var weekdays = new Array('So','Mo','Di','Mi','Do','Fr','Sa');

  var day = now.getDate();
  var weekday = now.getDay();  
  var month = now.getMonth()+1;
  var year = now.getFullYear();

  if(day<10){
    day = "0"+day;
  }
  if(month<10){
    month = "0"+month;
  }
  
  var timeString = ""+hours+":"+minutes+":"+seconds;
  uhr.innerHTML = timeString;

  var dateString = ""+weekdays[weekday]+", "+day+"."+month+"."+year;
  datum.innerHTML = dateString;

window.setTimeout("clock();", 1000);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function c4mcode(theform,c4mcode)
{
        theform.message.focus();
        text="";

        switch(c4mcode)
        {
                case 'IMG':
                {
                        pic = prompt("Gib ein hey!\n["+c4mcode+"]xxx[/"+c4mcode+"]",'http://');
                        if ((pic != null) && (pic != "http://")) 
                                text ="[img]"+pic+"[/img]\n"; 
                }break;
                case 'EMAIL':
                {
                        link = prompt("Gib hier die e-Mail Addresse ein!\n["+c4mcode+"]name@host.xx[/"+c4mcode+"]",'name@host.xx');
                        if ((link != null) && (link != "name@host.xx"))
                        {
                                text="["+c4mcode+"]"+link+"[/"+c4mcode+"]";
                                name = prompt("optional kannste hier nen linknamen angeben. \"mail mir\" z.b.!\n["+c4mcode+"="+link+"]xxx[/"+c4mcode+"]",'');
                                if ((name != null) && (name != "null")&& (name != "")) 
                                        text = "["+c4mcode+"="+link+"]"+name+"[/"+c4mcode+"] ";
                        }
                }break;

                case 'URL':
                {
                        link = prompt("Gib hier die Zieladdresse ein!\n["+c4mcode+"]xxx[/"+c4mcode+"]",'http://');
                        if ((link != null) && (link != "http://"))
                        {
                                text="["+c4mcode+"]"+link+"[/"+c4mcode+"]";
                                name = prompt("optional kannste hier nen linknamen angeben. \"klick mir!\" z.b.!\n["+c4mcode+"="+link+"]xxx[/"+c4mcode+"]",'');
                                if ((name != null) && (name != "null")&& (name != "")) 
                                        text = "["+c4mcode+"="+link+"]"+name+"[/"+c4mcode+"] ";
                        }
                }break;
                case 'html':
                case 'php':
                case 'c++':
                {
                        text  = "["+c4mcode+"]\nErsetzte diese Zeile mit deinem "+c4mcode+"-Source! Lass die C4M-tags aber stehen!!!\n[/"+c4mcode+"]\n";
                }break;
                case 'hr':
                {
                        text = "[hr]\n";
                }break;
                case 'list_bullet':
                {
                        makemylist(theform, "point");
                }break;

                case 'list_num':
                {
                        makemylist(theform, "num");
                }break;
                case 'color':
                {
                        if (win_ie_ver >= 5.5)
                        {
                                newcolor = showModalDialog("misc/select_color.html", '', "resizable: no; help: no; status: no; scroll: no;");
                                coloredtext = prompt("Gib hier den zu färbenden text ein.!\n["+c4mcode+"="+newcolor+"]xxx[/"+c4mcode+"]",'');
                                if ((coloredtext != null) && (coloredtext != "null")&& (coloredtext != "")) 
                                                text = "["+c4mcode+"="+newcolor+"]"+coloredtext+"[/"+c4mcode+"] ";
                        }
                        else
                        {
                                window.open("misc/select_color_noie.html", '', 'scrollbars=yes,width=500,height=400');
                        }


                }break;

                default: 
                {
                        //text = "["+c4mcode+"]"+prompt("Gib ein hey!\n["+c4mcode+"]xxx[/"+c4mcode+"]","")+"[/"+c4mcode+"]\n"; 
                        text = prompt("Gib ein hey!\n["+c4mcode+"]xxx[/"+c4mcode+"]","");
                        if ((text != null) && (text != "null")&& (text != ""))
                                text = "["+c4mcode+"]"+text+"[/"+c4mcode+"]"; 
                        else text="";
                }break;
        }
        theform.message.value += text;
}

function addsmylie(name,theform)
{
        theform.message.focus();
        theform.message.value+=name;
}