
$(document).ready( function () {
	
	var imageVisible = false;
	
	$("#id_whiteout_box").animate({width: "100%"}, 1000, "linear", function () {
		$("#id_whiteout_top").animate({marginTop: "-20px"}, 500, "linear");
		$("#id_whiteout_bottom").animate({marginTop: "+20px"}, 500, "linear");
		}).fadeOut("slow");
	
	// init für bigImg > lightBox
	
	$("div#lupe").click (function () {
		$("div#image_XXL").fadeIn("slow", function () {
			imageVisible = true;
			});
		$("img#lb_img").attr("src", $("img#bigimg").attr("alt"));
		});
	
	$("*").click (function () {
		if (imageVisible == true) {
				$("div#image_XXL").fadeOut("slow", function () {
					imageVisible = false;
					});
					}
		});

});

// browserweiche
function checkBrowserName (name) {  
	var agent = navigator.userAgent.toLowerCase();  
	if (agent.indexOf(name.toLowerCase())>-1) {  
		return true;  
		}
		
	return false;  
	} 
	
	// 24.09.2009 12:09:16
	// bugfix jQuery accordion 'flackern' im ie6
	if (checkBrowserName('MSIE')) { // ie
		$(function() {$("#accordion").accordion({active: false, autoHeight: false, animated:false});
		});
	} else { // nicht ie
		$(function() {$("#accordion").accordion({active: false, autoHeight: false});
		});
		}	


// >>> [gallery img reload hotfix ~ 14.09.2009 13:24:11] >>>>>>>>>>>>>>>>>>>>>>>

function img_actions (imagesrc, img_orig) {
	if (img_actions.oldsize < $('div#content').height() || !img_actions.oldsize) {
		img_actions.oldsize = $('div#content').height();
		}
		
	$('#bigimg').attr({src: imagesrc});
	$('#bigimg').attr({alt: img_orig});
	}

function changeobserver () {
	var newsize = $('div#content').height();
	if (newsize > img_actions.oldsize) {
		$('div#content').css({'height' : newsize});
		}}
	
function m_setImgN (imgPath) {
	$("#bigimg").attr("alt", imgPath);
	}

