jsHover = function ()
{
	var hEls = document . getElementById ( 'menu_top' ) . getElementsByTagName ( 'LI' ) ;

	for ( var i = 0, len = hEls . length ; i < len ; i++ )
	{
		hEls [ i ] . onmouseover = function () {
			this . className += ' jshover' ;
		}

		hEls [ i ] . onmouseout = function () {
			this . className = this . className . replace ( ' jshover', '' ) ;
		}
	}
}

if ( window . attachEvent && navigator . userAgent . indexOf ( 'Opera' ) == -1 )
	window . attachEvent ( 'onload', jsHover ) ;

$( function () {

	setTimeout ( function () {
		var div_height = $( '#content_center' ) . height () ;
		var bottom = $( '#content_bottom' ) . height () ;
		$( '.col_content' ) . height ( div_height - bottom - 200 ) ;
	}, 20 ) ;

	// setTimeout ( function () {
	// 	var col_height = 0 ;
	// 	$( '.col_content' ) . each ( function () {
	// 		col_height = Math . max ( col_height, $( this ) . height () ) ;
	// 	} ) ;
	//
	// 	$( '.col_content' ) . height ( col_height ) ;
	// 	alert ( col_height ) ;
	// }, 20 ) ;

	// $( document ) . pngFix () ;

	//begin: menu stuff
	$( 'li:contains("kontakt")' ) . hover (
		function () {
			var cssObj = {
				position: 'absolute',
				left: '-80px'
			}
			$( '#menu_top li div' ) . css ( cssObj ) ;
		},
		function () {
			var cssObj = {
				left: '0'
			}
			$( '#menu_top li div' ) . css ( cssObj ) ;
		}
	);
	//end: menu stuff


	//begin: contAccordion apply
	var ie6 =
		jQuery.browser.msie &&
		navigator.userAgent.match( /MSIE ([\d\.]+)/g )[0].split(" ")[1] < 7 ;

	$.contAccordion_conf ( [], {
		collapse: function(id,dom) {
		 	var css = ie6 ?
		 		{ filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.symmetrics.de/fileadmin/images/plus.png', sizingMethod='crop')" } :
		 		{ 'background-image': "url(http://www.symmetrics.de/fileadmin/images/plus.png)" } ;
			dom.find(".csc-header").css ( css );
		},
		expand: function(id,dom) {
		 	var css = ie6 ?
		 		{ filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.symmetrics.de/fileadmin/images/minus.png', sizingMethod='crop')" } :
		 		{ 'background-image': "url(http://www.symmetrics.de/fileadmin/images/minus.png)" } ;
			dom.find(".csc-header").css ( css );
		},
		header: ".csc-header",
		content: ".content-accordion"
	});

	$(".content-accordion-nest").contAccordion ();

	//end: contAccordion apply


	//begin: lightbox

	var elms = $( '.csc-textpic-image a' ) ;
	if ( elms && elms . length )
	{
		$.each ( elms, function () {
			if ( ! this . onclick ) return ;

			this . title = $( this ) . find ( 'img' ) . attr ( 'alt' ) ;
			this . onclick = null ;
			var url = String ( this . href . match ( /&file=(.+)&/ ) ) ;
			url = url . substring ( 6, url . length ) ;
			url = url . substring ( 0, url . search ( /&/ ) ) ;
			//url = url . replace(/%2F/g, "/");
			url = unescape(url);

			this . href = url ;
			//alert ( url ) ;

			$( this ) . lightbox () ;
		} ) ;
	}

	elms = $( 'a.lightbox' ) ;
	if ( elms && elms . length )
		elms . lightbox () ;

	//end: lightbox

} ) ;