jQuery(window).bind("load", function() {
	jQuery(document).ready(function($) {

		$("div#teaser div.csc-textpic-imagewrap").fadeIn(1000);

		if (($("div#flash-object").length != 0 && getFlashVersion().split(',').shift() < 10) || $("div#flash-object").length == 0) {

			$("div#flash-object").remove();

			var img_sources = [];
				$( "div.fce-crossslide-element img" ).each(
				function() {
					img_sources.push({src: $(this).attr("src")});
				}
			);

			$("div.fce-crossslide-container").fadeIn("slow", function() {
				$(this).crossSlide({
					sleep: 5,
					fade: 2
				}, img_sources);
			});
		}
		else {

			$("div.fce-crossslide-container").remove();
			$("div#flash-object").show();
		}

		$("form#search-form").submit(function() {
			if ($("input#search-form-input").val().length > 1) {
				return true;
			}

			return false;
		});

	});
});

function searchform_submit() {

	if (jQuery("#search-form-input").val().length > 1) {
		jQuery("#search-form").submit();
	}

}

function getFlashVersion() {
	try {
		try {
			var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try { axo.AllowScriptAccess = 'always'; }
			catch(e) { return '6,0,0'; }
			} catch(e) {}
			return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
		} catch(e) {
		try {
			if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		} catch(e) {}
	}
	return '0,0,0';
}

