function Foto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}
//  End -->
	
	/**
	 * 
	 */
	function lsWindowOpen(playerURL,breite,hoehe,windowName)
	{
		if (hoehe >= 2000){hoehe = screen.availHeight - 100;}  
		var win2;
		var leftPosition = getLeftPosition(breite);
		//breite = breite - 390;
		//alert(breite); 
		win2=window.open(playerURL,windowName,"width="+breite+",height="+hoehe+",left="+leftPosition+",top=0,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
		win2.resizeTo(breite,hoehe);
		win2.focus();
	}
	
	
	function getLeftPosition(breite)
	{
		var MaxBreite = screen.availWidth;
		var leftPosition = MaxBreite - breite;
		return leftPosition; 
	}
	
	function SetFullWindow()//Bringe das Fenster an die gew&uuml;nschte Position und die gew&uuml;nschte Gr&ouml;sse
	{
		window.moveTo(0,0);
		hoehe=screen.availHeight;
		screenbreite=screen.availWidth;
		window.resizeTo(screenbreite,hoehe);
	}
	
	
	function setFocusOnGoogleSearch()
	{
		document.f.sa.focus();
		document.bgColor='blue';
	}
	
	var zaehler = 1;
	var buttontext = "Bitte klicken";
	
	
	
	function blinken() 
	{
	if(zaehler==1) 
	{
		zaehler = 2;
		document.formularx.buttonx.color = '#FFF000';
//		document.formularx.buttonx.value = " ";			
	} 
	else 
	{
		zaehler = 1;
		document. formularx.buttonx.value = buttontext;
	}
	
	setTimeout('blinken()',1000);
	}



	//main - categories PopUp
	//flyout
	function showCategories(){
	document.getElementById('showCategories').style.display = "inline";
//hide selects - IE6
		/*hiddenElem = document.getElementById('catid');
		hiddenElem.style.visibility="hidden";*/

		hiddenElemInput = document.getElementById('searchkey');
		if (hiddenElemInput != null)
			{hiddenElemInput.style.visibility="hidden";}

	}
	function hideCategories(){
	  document.getElementById('showCategories').style.display = "none";
	 	
		/*hiddenElem = document.getElementById('catid');
		hiddenElem.style.visibility="visible";*/


		hiddenElemInput = document.getElementById('searchkey');
		hiddenElemInput.style.visibility="visible";

	}
	

	/*Rollover functions*/
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_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=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

/*From other file*/
function openWindow(winUrl, winWidth, winHeight, winArgs, winName)	{

	if(winUrl==null)	{ winUrl = ''; }
	if(winWidth==null || typeof winWidth != 'number')	{ winWidth = 600; }
	if(winHeight==null || typeof winHeight != 'number')		{ winHeight = 400; }
	if(winName==null)	{ winName = 'ctsWin'; }
	
	winArgs = "width="+winWidth+",height="+winHeight+","+winArgs;
	openWin = window.open(winUrl,winName,winArgs);
	openWin.focus();
	//return false;
}
/*
	Open window for detailed picture viewing
*/
function openPictureWin()	{
	openWindow('',750,550,'location=no,menubar=no,titlebar=no,scrollbars=yes,resizable=yes','detailPictures');
}

	
function MsgOkCancel()
{
	var fRet;

	if (window.document.getElementById('f_action').value == 'DELETE')
	{
		fRet = confirm(unescape("Sind Sie sicher dass Sie die ausgewahlten Elemente l%F6schen m%F6chten%3F"));
	}
	else if (window.document.getElementById('f_action').value == 'NOOP')
	{
		fRet = false; //do nothing  because nothing selected
	}
	else
	{
		fRet = true; //USER hat verl&auml;ngern gedr&uuml;ckt --> keine sicherheitsabfrage
	}
	return fRet; 
} 
var checkflag = "false";
function checkAll(field) {
	
	if (checkflag == "false") {
	  for (i = 0; i < field.length; i++) {
	  field[i].checked = true;}
	  checkflag = "true";
	  return " keine "; }
	else {
	  for (i = 0; i < field.length; i++) {
	  field[i].checked = false; }
	  checkflag = "false";
	  return " alle "; }
	}
	

	function getMaxScreenHeight()
	{
		return window.innerHeight - 80;
	}
	
	function getMaxScreenWidth()
	{
		return window.innerWidth - 80;
	}
	function prepareURLAttachment()
	{
		var test = "height=" + getMaxScreenHeight() + "&width=" + getMaxScreenWidth();
		return test;
	}

	function setWidthHeightAsCookie()
	{
		var width = 0;
		var height = 0;
		if (typeof(window.innerWidth) == 'number') {
		   //Non-IE
		   width = window.innerWidth;
		   height = window.innerHeight;
		} 
		else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		   //IE 6+ in 'standards compliant mode'
		   width = document.documentElement.clientWidth;
		   height = document.documentElement.clientHeight;
		
		} 
		else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		   //IE 4 compatible
		   width = document.body.clientWidth;
		   height = document.body.clientHeight;
		}
			document.cookie = "availHeight=" + (height - 140);
			document.cookie = "availWidth=" + (Math.round((width  - 43 - 300) / 2));
	}
	

	/*Additional external Scripts*/
	//JFavorite
	eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.8.9=7(d){g e=$.v({},$.8.9.k,d);g f=e.l;2.w(7(){5(!$(2).3(\'4\')||$(2).3(\'4\')=="#"){$(2).3(\'4\',j.x.4)}5(!$(2).3(\'6\')){$(2).3(\'6\',y.6)}5($.h.z){$(2).3(\'m\',$(2).3(\'4\')).3(\'4\',\'\').3(\'4\',\'A:B(0)\').3(\'C\',\'$.8.9.n(2,"\'+$(2).3(\'6\')+\'","\'+$(2).3(\'m\')+\'")\')}i{$(2).o(p)}});7 p(a){g b=$(2).3(\'4\');g c=$(2).3(\'6\');b=b.E("q:///","F://q/");5($.h.G){j.H.I(b,c)}i 5($.h.J){j.r.K(c,b,\'\')}i 5(L.M.N().O(\'P\')>-1){s(f)}i 5($.h.Q){s(f)}a.R()};t 2};$.8.9.k={l:\'S "T + D" U "V + D" W X, u Y 2 Z u 10 11.\'};$.8.9.n=7(e,a,b){e.12="r";e.6=a;e.4="";e.4=b;e.o();t 13}})(14);',62,67,'||this|attr|href|if|title|function|fn|jFav|||||||var|browser|else|window|defaults|msg|link|OperaBookmark|click|addToFavorites|file|sidebar|alert|return|to|extend|each|location|document|opera|javascript|void|onClick||replace|http|msie|external|AddFavorite|mozilla|addPanel|navigator|userAgent|toLowerCase|indexOf|chrome|safari|preventDefault|Press|Ctrl|or|CMD|for|MAC|add|page|your|bookmarks|rel|false|jQuery'.split('|'),0,{}))
	
