var sw = screen.width;

function setSW() {
	if (sw<=1024 && bodyID!="") {
		//WriteLayer(bodyID,"className","bg1024");
		if(bodyID == "neutral" || bodyID == "homepage" || bodyID == "dienexum") {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/dienexum_1024x768.jpg)";
		} else {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/"+bodyID+"_1024x768.jpg)";
		}
	} else if (sw<=1280 && bodyID!="") {
		//WriteLayer(bodyID,"className","bg1280");
		if(bodyID == "neutral" || bodyID == "homepage" || bodyID == "dienexum") {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/dienexum_1280x1024.jpg)";
		} else {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/"+bodyID+"_1280x1024.jpg)";
		}
	} else if (sw<=1600 && bodyID!="") {
		//WriteLayer(bodyID,"className","bg1600");
		if(bodyID == "neutral" || bodyID == "homepage" || bodyID == "dienexum") {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/dienexum_1600x1200.jpg)";
		} else {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/"+bodyID+"_1600x1200.jpg)";
		}
	} else if (sw<=1920 && bodyID!="") {
		//WriteLayer(bodyID,"className","bg1920");
		if(bodyID == "neutral" || bodyID == "homepage" || bodyID == "dienexum") {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/dienexum_1920x1440.jpg)";
		} else {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/"+bodyID+"_1920x1440.jpg)";
		}
	} else {
		//WriteLayer(bodyID,"className","bg1920");
		if(bodyID == "neutral" || bodyID == "homepage" || bodyID == "dienexum") {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/dienexum_1920x1440.jpg)";
		} else {
			document.getElementById(bodyID).style.backgroundImage = "url(images/wallpaper/"+bodyID+"_1920x1440.jpg)";
		}
	}
}




function searchClick(search,lang) {
	if(search.value == 'Suche' || search.value == 'Search') {
		search.value = '';
	}
}

function searchRelease(search,lang) {
	if(search.value == '') {
		if(lang == 'en') {
			search.value = 'Search';
		} else {
			search.value = 'Suche';
		}
	}
}

function checkBrowserName(name){  
	var agent = navigator.userAgent.toLowerCase();  
	if (agent.indexOf(name.toLowerCase())>-1) {  
		return true;  
	}  
	return false;  
}

if(checkBrowserName('PLAYSTATION')){ 
	document.write('<link href="styles/ps3.css" rel="stylesheet" type="text/css" />');
}

if(checkBrowserName('SAFARI')) {
	document.write('<link href="styles/safari.css" rel="stylesheet" type="text/css" />');
}




