// JavaScript Document
// Browserabfrage
var ie = navigator.appName.indexOf("Microsoft") != -1;
var ns = Number(navigator.appVersion.substring(0,1));




function confirm_delete(url, message){
	Check = confirm(message);
	
	if (Check == true){
		window.location.href=url;
	}
}
function switchLayer(l1, l2){
		document.getElementById(l1).style.display='none';
	document.getElementById(l2).style.display='block';
 }


function open_window(url,win_name, breite, hoehe, pos)
{
	if(pos == "center"){
		var new_left = (screen.width-breite)/2;
		var new_top = (screen.height-hoehe)/2;
	}else if(pos == "lefttop"){
		var new_left =0;
		var new_top = 0;
	}else{
		var new_left = (screen.width-breite)/2;
		var new_top = (screen.height-hoehe)/2;
	}
  	fenster=window.open(url, win_name, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resize=yes,width='+breite+',height='+hoehe+',left='+new_left+',top='+new_top+''); 
	fenster.focus();
	window.status = "SHIRTWERK";
}

function open_popup(url,win_name, breite, hoehe, pos)
{
	if(pos == "center"){
		var new_left = (screen.width-breite)/2;
		var new_top = (screen.height-hoehe)/2;
	}else if(pos == "lefttop"){
		var new_left =0;
		var new_top = 0;
	}else{
		var new_left = (screen.width-breite)/2;
		var new_top = (screen.height-hoehe)/2;
	}
  	fenster=window.open(url, win_name, 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resize=yes,width='+breite+',height='+hoehe+',left='+new_left+',top='+new_top+''); 
	fenster.focus();
	window.status = "SHIRTWERK";
}


function play_video(video_url, qualitiy, title){
		var w=screen.width;
		var h=screen.height;
		url = "../cms/play_video.php?u="+video_url+"&q="+qualitiy + "&t="+title+"&sw="+w+"&sh="+h;
 		open_window(url,"videos", 100, 100, "center")
}
function open_image(image_url, title){
		var w=screen.width;
		var h=screen.height;
		url = "php/open_image.php?u=" + image_url + "&t="+title+"&w="+w+"&h="+h;
 		open_window(url,"Image", 10, 10, "lefttop")
}