﻿var slideShowInterval;
var slideActive;
var parentAccordion;


$(document).ready(function() {
	//Does a PNG Fix for old browsers
	$(document).pngFix(); 
	//FIX THE GLOBAL NAVIGATION FOR IE
	$("#navmenu-h li,#navmenu-v li").hover(
		function() { $(this).addClass("iehover"); },
		function() { $(this).removeClass("iehover"); }
	);
	//CONFIGURES THE MAIN NAVIGATION 
	$("#navmenu-h ul li:first-child").addClass("firstSubElement");
	$("#navmenu-h ul li:last-child").addClass("lastSubElement");
	//
	$("#sitemap .row:last-child").css("margin-right", "0");		
});
function initContent()
{
	/*$('.bookText').columnize({width:250});
	$(".column ul li").filter(':empty').css("visibility", "hidden");*/
		
	initAccordion();
	initForm();

}
function initAccordion()
{
	if($("#acc").length > 0)
	{
		parentAccordion = new TINY.accordion.slider("parentAccordion");
		parentAccordion.init("acc","h3");
	}
	$("#main .content:empty").hide();
}
function initForm()
{
	if($(".tx-pilmailform-pi1").length > 0)
	{
		$('form').jqTransform({imgPath:'img/form/'});
	}
}
function initHome()
{
	$("#teaserHolder .teaser:last-child").css("margin-right", "0");	
	//
	$('#slideshow').cycle({
		fx:     'fade',
		speed:  '3000',
		timeout: 0,
		next:   '.rightButton',
		prev:   '.leftButton',
		after:   onAfter,
		slideExpr: 'img'
	});
    

}
function onAfter() {
    $('#output').html("Current anchor: " + this.href);
}
