function setEqual(){
    var left="left"
    var right="right"
    if(document.getElementById(left).clientHeight<document.getElementById(right).clientHeight){
        document.getElementById(left).style.height=document.getElementById(right).clientHeight+"px"
    }else{
        document.getElementById(right).style.height=document.getElementById(left).clientHeight+"px"
        }
    document.getElementById("wrapper").style.height=document.getElementById(left).clientHeight+"px"
    }
function change_bg(i,id){
    $(".liner a").removeClass("active");
    $("#"+id).addClass("active");
    $("#header").css("backgroundImage","url(/images/header_img_0"+i+".jpg)");
}
function simplePreload(){ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++){
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}
function change_bg_url(url,id){
	$(".liner a").removeClass("active");
	$("#"+id).addClass("active");
	$("#header").css("backgroundImage","url("+url+")");
}
Cufon.replace('.h1',{
    fontSize: '22px',
    color: '#a19163'
})
Cufon.replace('.alternate',{
    fontSize: '22px',
    color: '#8e311f'
})
function entSchl(s){
    var n=0
    var r=""
    for(var i=0;i<s.length;i++){
        n=s.charCodeAt(i)
        if(n>=8364){
            n=128
            }
        r+=String.fromCharCode(n-1)
        }
    return r
    }
function mailEnt(s){
    location.href=entSchl(s)
    }
function sleep(ms) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > ms){
      break;
    }
  }
}


function slide(arr){
		var i = 0;
	for(i = 0; i < arr.length; i++){
	 setInterval(change_bg_url(arr[i],"b"+i), 5000);	
	}
}
$(document).ready(function(){
    $(".video").click(function(){
        $.fancybox({
            'padding'	: 0,
            'autoScale'	: false,
            'transitionIn' : 'none',
            'transitionOut' : 'none',
            'title'	: this.title,
            'width' : 680,
            'height'	: 495,
            'href'	: this.href.replace(new RegExp("watch\\?v=","i"),'v/'),
            'type'	: 'swf',
            'swf'	:{
                'wmode' : 'transparent',
                'allowfullscreen'	: 'true'
            }
        })
        return false 
    });
	$(".fancy div a").fancybox({
        'showCloseButton'	: true,
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic'
    }); 
	$("a[rel=bilder]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over'
			});
})


