/**
 * @author ivan
 */

$(document).ready(function(){

	//$("body").css("background", "transparent url('fileadmin/girlscup_2010/images/header.jpg') no-repeat -2px 7px");
	function outputStatus(e) {
		//alert("e.success = " + e.success +"\ne.id = "+ e.id +"\ne.ref = "+ e.ref);
	    //e.success = Boolean to indicate whether the embedding of a SWF was success or not
	    //e.id = String indicating the ID used in swfobject.registerObject
	    //e.ref = HTML object element reference (returns undefined when success=false)
		if (!e.success) {
			$("body").css("background", "transparent url('fileadmin/girlscup_2010/images/header.jpg') no-repeat center 7px");
			//alert("e.success = " + e.success +"\ne.id = "+ e.id +"\ne.ref = "+ e.ref);
		}
		if (e.success) {
			//$("body").css("background", "transparent url('fileadmin/girlscup_2010/images/header.png') no-repeat center 2px");
			//alert("e.success = " + e.success +"\ne.id = "+ e.id +"\ne.ref = "+ e.ref);
				var browser=navigator.appName;
				var b_version=navigator.appVersion;
				var version=parseFloat(b_version);
				var IE6 = (navigator.appVersion.indexOf("MSIE 6.")==-1) ? false : true;
				if (IE6)
				{
					$("body").css("background", "transparent url('fileadmin/girlscup_2010/images/header.png') no-repeat center 4px");
				}else {
					$("body").css("background", "transparent url('fileadmin/girlscup_2010/images/header.png') no-repeat center 2px");
				}
		}
	}
	swfobject.embedSWF("/fileadmin/girlscup_2010/images/AGC-Header-Video.swf", "header_image", "995", "262", "9.0.0", "expressInstall.swf", null, {wmode:"transparent"}, null, outputStatus);
	//added flash
	function loadSWF() {
		alert('Opa')
	}

//	swfobject.addLoadEvent(loadSWF);



	//$('#header').css('padding-top','0px');
	//$('#topnav').css('top','-413px');

	$("body").append('<div id="anzag_gallery" class="simple_overlay" style="display: none">'+
		'<a class="prev" style="flo">zur&uuml;ck</a>'+
		'<a class="next">vor</a>'+
		'<img class="progress" src="fileadmin/girlscup_2010/images/gallery/loading.gif" />');

	if($("#col2_content .csc-textpic a.lightbox").length>0){
		$("#col2_content .csc-textpic a.lightbox").overlay({
			// each trigger uses the same overlay with the id "gallery"
			target: '#anzag_gallery',

			// optional exposing effect
			expose: '#9aae10'

			// let the gallery plugin do its magic!
		}).gallery({
			autohide: true,
			// the plugin accepts its own set of configuration options
			speed: 800
		});
	}


	// Tabelle
	// extend the default setting to always include the zebra widget.
	if ($(".tablesorter").length) {
		$.tablesorter.defaults.widgets = ['zebra'];
		// call the tablesorter plugin
		$(".tablesorter").tablesorter();
	}

});

