var id;

function button_Normal(id) {
	document.getElementById(id).className = "Button"; 
}
function button_Over(id) {
	document.getElementById(id).className = "Button_Over"; 
}

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

// toggle - > expand / collapse
function toggle(id) {
	
	if (document.getElementById("ToggleRow_" + id).style.display == 'none') {
		document.getElementById("ToggleImg_" + id).src = "images/icons/less.gif";
		document.getElementById("ToggleRow_" + id).style.display = "inline";
		document.getElementById("ToggleImg_" + id).alt = "read more";
	}
	else {
		document.getElementById("ToggleImg_" + id).src = "images/icons/more.gif";
		document.getElementById("ToggleRow_" + id).style.display = "none";
		document.getElementById("ToggleImg_" + id).alt = "hide";
	}
}

// div change
var ns6=document.getElementById&&!document.all 
var ie=document.all 

function show_text(thetext, whichdiv) { 

if (ie) eval("document.all."+whichdiv).innerHTML=thetext
else if (ns6) document.getElementById(whichdiv).innerHTML=thetext

} 

function reset(whichdiv){ 

if (ie) eval("document.all."+whichdiv).innerHTML='' 
else if (ns6) document.getElementById(whichdiv).innerHTML=''

} 

// select all für comments
function SelectAll() {
	for(var x=0;x<document.form.elements.length;x++) {
		var y=document.form.elements[x];
		if(y.name!='ALL') y.checked=document.form.ALL.checked;
	}
}

function zeigeBild(sel) {
  document.minibild.src = "" + sel.options[sel.selectedIndex].value;
}

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

function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function jumpMenuGo(selName,targ,restore){ 
  var selObj = findObj(selName); if (selObj) jumpMenu(targ,selObj,restore);
}

function addParameter(table, rowIndex, bg)
{
    var row = table.insertRow(rowIndex);
    var cell = row.insertCell(0);
	cell.setAttribute("bgcolor", "white", false);
    var text = document.createTextNode('');
    cell.appendChild(text);
    cell = row.insertCell(1);
    var input = document.createElement('INPUT');
    cell.setAttribute("bgcolor", "white", false);
  	input.type = 'file';
    input.name = 'image[]';
    input.size = '37';
    cell.appendChild(input);
}

function getWinSize(win)
{
    if(!win) win = window;
    var s = new Object();
    if(typeof win.innerWidth != 'undefined')
    {
        s.width = win.innerWidth;
        s.height = win.innerHeight;
    }
    else
    {
         var obj = getBody(win);
         s.width = parseInt(obj.clientWidth);
         s.height = parseInt(obj.clientHeight);
    }
    return s;
}