jQuery(document).ready(function(){ 
//checken, ob cookies überhaupt gesetzt werden können, wenn nicht, führt animation nicht aus
var placementtest = false;
if(document.URL.split("=")[1] == '142'){
	placementtest = true;
}
jQuery('#flash').flash({
	swf: '/fileadmin/templates/flash/map.swf',
	params: {   
		wmode:'transparent',
		allowScriptAccess: 'always',
		swliveconnect: 'true'     
		},   
	flashvars: {  
		rewindAnimation: 'false'
	

	}, 
	attributes: {
		name: 'map'
	},
	height: 476,   
	width: 892,
	id: 'map'

});

if(!placementtest){
if(document.cookie){
//checken, ob animations cookie gesetzt
	var cookies = document.cookie.split(';');
	var cookie_set = false;

	for(var i = 0; i < cookies.length; i++){
		var cookie_name = cookies[i].split("=");
			if (cookie_name[1] == "1")cookie_set = true;
	}



//if animation = 1, dann scrollMap nicht ausführen
		if (!cookie_set || document.URL == ""){
		
		if(navigator.appName == 'Microsoft Internet Explorer'){
		jQuery('#flash').empty();
		jQuery('#flash').flash({
			swf: '/fileadmin/templates/flash/map.swf',
				params: {   
					wmode:'transparent',
					allowScriptAccess: 'always',
					swliveconnect: 'true'     
				},
				attributes: {
				name: 'map'
				},				
				flashvars: {  
				rewindAnimation: 'ie'
	

			},   
	height: 476,   
	width: 892,
	id: 'map'
	});	
		}else{
		
		jQuery('#flash').empty();
		jQuery('#flash').flash({
			swf: '/fileadmin/templates/flash/map.swf',
				params: {   
					wmode:'transparent',
					allowScriptAccess: 'always',
					swliveconnect: 'true'     
				},
				attributes: {
				name: 'map'
				},				
				flashvars: {  
				rewindAnimation: 'true'
	

			},   
	height: 476,   
	width: 892,
	id: 'map'

});
}
		//flashvars zurücksetzen.
		scrollMapFirst();

		/*Cookie setzen*/
		var a = new Date();
		a = new Date(a.getTime() +1000*60*60*24*365);
		document.cookie = 'animation = 1; expires='+a.toGMTString()+';path = /'; 
		
		//animation aufrufen
		
		}		
}
}
});
