var rotation;
var sinus;
var pointer=0;
var timer;
onload=function() {
	if (Silverlight.isInstalled("3.0.40624.0")) {
		var pe1 = document.getElementById("stark");
		var iswl='true';
		var thisbg='transparent';
		if(navigator.appVersion.search("Windows")!=-1&&(navigator.appVersion.search("Safari")!=-1||navigator.appName.search("Opera")!=-1)) {
			iswl='false';
			thisbg='white';
			}
		Silverlight.createObjectEx(
			{
				source: '/fileadmin/templates/templates/MainPage.xaml', 
				parentElement:pe1, 
				id:'Ag123', 
				properties:{ width:'210', height:'220', background:'#00000000', background: thisbg, isWindowless:iswl, framerate:'50', version:'0.90.0' }, 
				events:{ onError:null, onLoad:null }, 
				context:null
				}
			);
		}
	}
function startsl(s,a) {
	rotation=s.FindName("rtf");
	setTimeout("rotieren()",0);
	}
function stopsl(s,a) {
	clearTimeout(timer);
	}
function gosl() {
	location.href="http://www.stark-fuer-die-pflege.de/Jetzt-mitmachen.mitmachen.0.html";
	}
function rotieren() {
	rotation.SetValue("Angle", (Math.sin(pointer)*5)-5);
	pointer++;
	timer=setTimeout("rotieren()",80);
	}
	
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkDisclaimer()
{
	SHLdisclaimer=getCookie('SHLdisclaimer');
if (SHLdisclaimer!=null && SHLdisclaimer!=""){
}
else{
	// Damir. Visiting for the first time. Load the disclaimer AJAX window.

	SHLdisclaimer=('visited',"1");

	if (SHLdisclaimer!=null && SHLdisclaimer!="visited")
	$(document).ready(function(){
		tb_show("Diakonisches Werk und Caritas", "http://www.stark-fuer-die-pflege.de/index.php?id=197&type=97&TB_iframe=true&height=650&width=850",false)
	});

	// Damir. Set Cookie. Change "1" to anything from 1 to 365 to keep the cookie alive
{
	setCookie('SHLdisclaimer',SHLdisclaimer,1);
}
}
}
	