jQuery.noConflict();
jQuery(document).ready(function() {

	/* 
		### --- POPUP --- ### 
	*/
	
		cci 		= document.cookie;
		ccipos		= cci.indexOf('werbelayer=');
		ccivalue	= cci.substr(ccipos+11,1);
		if(ccivalue!=1) {
			startPopup();
		}
		
		jQuery("#angebot a").click(function(){
			startPopup();
			return false;
		});
		jQuery("#angebot a").html("Aktion anzeigen");

		jQuery("#popuplayer").append('<a href="#close" id="close"><img src="fileadmin/Template/images/close.png" title="Fenster schließen" alt="X" /></a>');
			
		jQuery("#popuplayer a#close").click(function() {
			jQuery(this).parent().animate({left:"-350px"},1000);
			return false;
		});

	/* 
		### --- SLIDER --- ### 
	*/
		jQuery('#slide-images ul li').each(function(){
			jQuery("a:first",this).remove();
		});
		
		jQuery('#slide-images ul').innerfade({
			animationtype: 'fade',
			speed: 1000,
			timeout: 8000,
			type: 'sequence',
			containerheight: '262px'
		});
		
	/* 
		### --- NAVIGATION --- ### 
	*/
	
		jQuery("#navigation li").hover(function() {
			jQuery("ul:first",this).stop(true,true).fadeIn("fast");
		},function () {
			jQuery("ul:first",this).stop(true,true).fadeOut("fast");
		});
		
		/*jQuery("#navigation a:contains('ul')").click(function() {
			alert("sub");
		});*/			
		
		
	/* 
		### --- PRODUKTE --- ### 
	*/
			
		jQuery(".produkt-box li.image a").each(function() {
			var produkt = jQuery(this).parent();
			jQuery(this).prepend('<img src="fileadmin/Template/images/icon-zoom.png" class="icon" alt="Zoom" />');
			jQuery(this).attr("href",jQuery(".fullsize",produkt).attr("src"));
			jQuery(this).attr("title",jQuery("span",produkt).html());
			jQuery(this).fancybox({'titlePosition':'inside'});
		});
		
		jQuery(".produkt-box li.pdf a").each(function() {
			jQuery(this).prepend('<img src="fileadmin/Template/images/icon-pdf.png" class="icon" alt="PDF" />');
		});
		
	/* 
		### --- SONSTIGES --- ### 
	*/
	//jQuery("#main-img").append('<img class="read-more" src="fileadmin/Template/images/icon-more.png" alt="Zur Unterseite" />');
	
	jQuery(".box-content img").unwrap();
	
	/*if( jQuery("#text-content").length > 0 ) {
		jQuery("#content-head").remove();
		jQuery("#text-content").unwrap();
		jQuery("#content-foot").remove();
	}*/
	
jQuery('#mailformAnrede').focus();
	
});
		
	/* 
		### --- FUNKTIONEN --- ### 
	*/
	
		function startPopup() {
				jQuery("#popuplayer").animate({left:"50%"},2000);
				
				var ckitime = new Date();
				ckitime = new Date(ckitime.getTime() +1000*60*60*24*365);
				document.cookie = "werbelayer=1; expires="+ckitime.toGMTString()+"; path=/";
				return false;
		}

