$(document).ready(function() {
	
	//pngfix for ie
	$(document).pngFix();
	
	$("img[rel]").overlay({expose: { 
		 
				color: '#000', 
				loadSpeed: 200, 
				opacity: 0.8 
			}});
	
	
	//weitersagen
	$("a[rel]").overlay({expose: { 
		 
				color: '#000', 
				loadSpeed: 200, 
				opacity: 0.8 
			}});

	$("a#weitersagenLink").click(function() {
		
		var link = this.href;
		
		$("#tell").overlay({ 
 
			onBeforeLoad: function() { 
 
				var wrap = this.getContent().find(".contentWrap"); 

				wrap.load(link); 
			},
 
			expose: { 
		 
				color: '#000', 
				loadSpeed: 200, 
				opacity: 0.8 
			}, 
	 
			closeOnClick: true, 
	 
			api: true 
	 
		}).load();
			
		return false;
		}
		
	)



	/* home */

	var rand = Math.random();

	if($('#home_player').is('*')) {
		flashembed("home_player", {
			src: "/wp-content/themes/mobilombo/swf/viewer_mobilombo.swf?"+rand, //http://www.ustream.tv/flash/live/8848/GoToGoedgedacht
			//http://www.mobilombo.com/wp-content/themes/mobilombo/swf/viewer.swf

			// provide large enough version number so we can see what happens
			version: [9, 0],
		
			wmode: 'opaque',
		
			allowfullscreen: 'true',
		
			name: "utv_n_889184",
		
			width: 495,
			height: 305,

			// supply your path to the express install Flash object.
			expressInstall: "/wp-content/themes/mobilombo/swf/expressinstall.swf",

			// called every time the supported version is not found
			onFail: function() {
				document.getElementById("home_player").innerHTML = "<div id='noflash'><p>Oops! Du brauchst den aktuellen Flash Player um das MOBILOMBO zu sehen. Einfach hier herunterladen.<br /><a id=getflashplayer' href='http://get.adobe.com/de/flashplayer/'>Flash Player runterladen</a></p></div>";
			}
			}, { 
						    // these properties are given for the Flash object 
						    autoplay: 'true', 
						    brand: 'embed', 
						    cid: '8848%2Ftest',
							language: lang
			}
		);
	}
	
	
	/*counter */
	if($('#counter').is('*')) {
		flashembed("counter", {
			src: "/wp-content/themes/mobilombo/swf/counter.swf",

			// provide large enough version number so we can see what happens
			version: [9, 0],
		
			wmode: 'opaque',
		
			allowfullscreen: 'true',
		
			name: "count",
		
			width: 124,
			height: 37,

			// called every time the supported version is not found
			onFail: function() {
				document.getElementById("home_player").innerHTML = "Kein Flash?";
			}
			}
		);
	}
	



	/* was bisher geschah popups */
	$("ol li a").click(function() {
		
		var link = this.href;
		
		$("#overlayVideo").overlay({ 
 
			onBeforeLoad: function() { 
 
				var wrap = this.getContent().find(".contentWrap"); 

				wrap.load(link); 
			},
 
			expose: { 
		 
				color: '#000', 
				loadSpeed: 200, 
				opacity: 0.8 
			}, 
	 
			closeOnClick: true, 
	 
			api: true 
	 
		}).load();
			
		return false;
		}
		
	)
	
	
	
	
});
