﻿window.addEvent('domready',function() {  
	    
	 if ($('aktuell1')){   
	    
	   var myDrag = new Drag('aktuell1', {
    		onComplete: function(el){
 				 Cookie.write('aktuell1X',el.getLeft(),  {domain: 'buero4.ch', path: '/'});
				 Cookie.write('aktuell1Y',el.getTop(),  {domain: 'buero4.ch', path: '/'});	
    		}
    	});
    
    	if ( Cookie.read('aktuell1X')){
			$('aktuell1').setStyles({
				'left': Cookie.read('aktuell1X')+'px',
				'top': Cookie.read('aktuell1Y')+'px'
			});
		}else{
			$('aktuell1').setStyles({
				'left':'650px',
				'top': '210px'
			});
		}
	}
	if ($('aktuell2')){   
	    
	   var myDrag2 = new Drag('aktuell2', {
    		onComplete: function(el){
 				 Cookie.write('aktuell2X',el.getLeft(),  {domain: 'buero4.ch', path: '/'});
				 Cookie.write('aktuell2Y',el.getTop(),  {domain: 'buero4.ch', path: '/'});	
    		}
    	});
    
    	if ( Cookie.read('aktuell2X')){
			$('aktuell2').setStyles({
				'left': Cookie.read('aktuell2X')+'px',
				'top': Cookie.read('aktuell2Y')+'px'
			});
		}else{
			$('aktuell2').setStyles({
				'left':'750px',
				'top': '150px'
			});
		}
	}
	if ($('aktuell3')){   
	    
	   var myDrag3 = new Drag('aktuell3', {
    		onComplete: function(el){
 				 Cookie.write('aktuell3X',el.getLeft(),  {domain: 'buero4.ch', path: '/'});
				 Cookie.write('aktuell3Y',el.getTop(),  {domain: 'buero4.ch', path: '/'});	
    		}
    	});
    
    	if ( Cookie.read('aktuell3X')){
			$('aktuell3').setStyles({
				'left': Cookie.read('aktuell3X')+'px',
				'top': Cookie.read('aktuell3Y')+'px'
			});
		}else{
			$('aktuell3').setStyles({
				'left':'850px',
				'top': '190px'
			});
		}
	}

 /* handler */
 
/*
$('handler').addEvent('click', function(){ 
 	//alert('over'); 
 	$('aktuell1').setStyles({
 			'height' : '10px'
 		});	
 });
 */
 
});	


var zIndex = 100;

function up(what,what2){
	zIndex++;
	what.style.zIndex = zIndex;
	what.style.visible = true;
	what.style.visibility = "visible";
	document.getElementById(what2).style.visibility="visible";
}
var zIndex2 = 2000;
function up2(what ){
	zIndex2++;
	what.style.zIndex = zIndex2;
}


function notvisi(what){
	if ((globalvar["ordner"+ what]) != "visited"){
		document.getElementById(what).style.visibility="hidden";
	}else{
		document.getElementById(what).style.visibility="visible";

	}
}

function ausblenden(was){
	document.getElementById(was).style.visibility = "hidden";
}

function email(name,vorname,domain,tld){
  if(tld=="") { tld="ch"};
  if(domain=="") { domain="buero4"};
  if(vorname=="") {
    window.location.href = "mailto:"+name+"@"+domain+"."+tld;
  } else {
    window.location.href = "mailto:"+name+"."+vorname+"@"+domain+"."+tld;
  }
}

