function popup(url,name,width,height)
{
	popupWin=window.open(url,name,"toolbar=no,directories=no,menubar=no,scrollbars=yes,status=no,location=no,resizable=no,width="+width+",height="+height);
}


function checkall(plt,plf) 
{
	expr = new RegExp("^"+plt);
	for (var i=0;i<document.cdk_form.elements.length;i++) 
	{

		var e = document.cdk_form.elements[i];
		var fieldname = e.name;
		var Ergebnis = fieldname.search(expr);
		if ((e.name != 'allbox') && (e.type=='checkbox') && (Ergebnis == '0')) 
		{
			e.checked = document.cdk_form.elements[plf].checked;
		}
	}
}

function putFocus(formInst, elementInst) 
{
	if (document.forms.length > 0) 
	{
 		document.forms[formInst].elements[elementInst].focus();
	}
}	

			
function cdk_HideAndShow_byid(id) 
{
	if(document.getElementById(id).style.display=='none') 
	{
		document.getElementById(id).style.display='block';
	} else {
		document.getElementById(id).style.display='none';
	}
}

function setchecked(datein)
{
  for (i = 0; i < document.getElementsByTagName('input').length; ++i)
  {
    o=document.getElementsByTagName('input')[i];
    if(o.type=='checkbox' && o.id==datein)
    {
     	o.checked=true;
    }
    if(document.getElementById('all_'+datein).checked == false && o.id==datein)
    {
    	o.checked=false;
    }
	}   
}

var win=null;
function popUpWindow(mypage,myname,w,h,pos,infocus)
{
  if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
  if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
  else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
  settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
  win.focus();
}

function popitup(url) 
{
	var newwindow = window.open(url,'IMAGE_COMMENT','height=550,width=600');
	if (window.focus) {
		newwindow.focus();
	}
}

function hideshowjq(buttonid,imageid)
{
    if($(buttonid).is(':visible')) 
    {
      $(buttonid).animate({height: 'hide'}, 500);
      $(imageid).attr("src","/img/arrow_down_16x16.gif");
    } else {	    	
    	$(buttonid).animate({height: 'show'}, 500);
    	$(imageid).attr("src","/img/arrow_up_16x16.gif");
    }
}

button1= new Image();
button1.src = "/img/menue2/menu_0.gif"
button2 = new Image();
button2.src = "/img/menue2/news.gif"
button3 = new Image();
button3.src = "/img/menue2/tv.gif"
button4 = new Image();
button4.src = "/img/menue2/community.gif"
button5 = new Image();
button5.src = "/img/menue2/games.gif"
button6 = new Image();
button6.src = "/img/menue2/artikel.gif"
