jQuery(document).ready(function(){

    //jQuery(".col1_content_container:first").css("background-color" , "#013986");	
    //jQuery(".col1_content_container:first").css("height", "269px");
    jQuery(".col1_content_container_contentPage").css("min-height", jQuery("#col2").height() - 220 - 15);
    jQuery(".col1_content_container").css("margin-top", "22px");
    //jQuery(".col1_content_container:first").css("margin-top", "0px");	
    jQuery("main_nav_content #menuLevel2 li:first").css("float", "left");
    jQuery("#col2_content_1 div.csc-header").css("display", "none");
    jQuery("#col2_content_1 .col2_teaser_content_container:first").css("margin-top", "15px");
    jQuery("#col2_content_2 .col2_teaser_content_container:first").css("margin-top", "15px");
    jQuery("#col2_content_2 div.csc-header").css("display", "none");
    //alert(jQuery(".menuLevel2").position().left);
    if (jQuery(".menuLevel2").position().left <= 18) {
        jQuery("#main_nav_content div.menuLevel3").css("left", "15px");
    }
    else {
        jQuery("#main_nav_content div.menuLevel3").css("left", -jQuery(".menuLevel2").position().left - 3);
    }
    jQuery("#main_nav_content ul li:nth-child(2)").css("width", "116px");
    
    jQuery("#main_nav_content ul li a.active").append("<img src='fileadmin/img/dreambowl/pfeil.png'  style='width:12px; height:8px; border:0px;padding-left:5px;' width='12' height='8'/>");
    
    jQuery("#main_nav_content a[href*='gastronomie/']").html("GASTRONOMIE");
    jQuery("#col2_content_1").prepend('<div style="float: left; width:336px; height: 4px;"><img src="fileadmin/img/dreambowl/borderTopContainer.gif" style="width:336px; height: 4px;"/></div>');
    jQuery("#col2_content_2").prepend('<div style="float: left; width:336px; height: 4px;"><img src="fileadmin/img/dreambowl/borderTopContainer.gif" style="width:336px; height: 4px;"/></div>');
    jQuery("#col2 h1.boxhead").css("color", "#ffffff");
    jQuery(".contentTeaserBoxContent h1:first").css("border:0px;");
    jQuery(".news-list-itemNew h3 a:first").css("color", "#388bef");
    jQuery(".news-latest-item h3 a:first").css("color", "#388bef");
    jQuery.each(jQuery(".news_icon"), function(){
        jQuery(this).css("height", jQuery(".news-list-itemNew").height());
    });
    jQuery(".news_icon:first").append("<div class='news_latest_icon2'></div>");
    
    
    if (jQuery('.tx-dreambowlslideshowbox-pi1').length == 0 && jQuery(".menuLevel3").length == 0) {
        jQuery(".col1_content_container_contentPage_content").css("margin-top", "15px");		
    }
    else 
        if (jQuery('.tx-dreambowlslideshowbox-pi1').length == 0 && jQuery(".menuLevel3").length > 0) {
            jQuery(".col1_content_container_contentPage_content").css("margin-top", "40px");
			
        } 
		
	if (jQuery('.tx-dreambowlslideshowbox-pi1').length > 0 && jQuery(".menuLevel3").length > 0) {
		jQuery("#slideshow_container").css("margin-top", "-40px");
	}
    
    if (jQuery(document).width() < 960) {
        jQuery("body").css("background-image", "url('fileadmin/img/dreambowl/bg_body2.jpg')");
        jQuery("body").css("background-position", "0px 0px");
        
    }
    
    
    
    jQuery(".internalLink").append('<img alt="dreambowl" style="padding-left: 5px;" src="fileadmin/img/dreambowl/arrow_r.png"/>');
    
    jQuery('a[href$="pdf"]').attr("rel", "prettyPhoto");
    jQuery('a[href$="pdf"]').css("color", "#404040");
	jQuery('a[href$="pdf"]').addClass("pdf");
    jQuery.each(jQuery('a[href*=".pdf"]'), function(){
        $downloadlink = jQuery(this).text();
        $href = jQuery(this).attr("href");
        $href = $href + "?iframe=true&width=80%&height=90%";
        jQuery(this).attr("href", $href);
        
        jQuery(this).html('<div style="clear: both; margin-top: 7px; height: 23px;"><div style="float:left;"><img src="fileadmin/img/dreambowl/download.png" alt="dreambowl download"/></div><div style="float: left; margin-left: 10px; margin-top: 4px;">' + $downloadlink + ' (pdf-Format)</div></div>');
    });
    
    //jQuery('a[href*="bowling/online-reservierung/"]').attr("rel", "prettyPhoto");
	//$href2 = jQuery('a[href*="bowling/online-reservierung/"]').attr("href");
	//$href2 = $href2 + "?iframe=true&width=109%&height=100%";
	//$href2 = jQuery('a[href*="bowling/online-reservierung/"]').attr("href", $href2);
	jQuery('a[href*="bowling/online-reservierung/"]').attr("target", "_blank");
    
    //jQuery('a[href$="pdf"]').append(' (pdf-Format)');
    
    //alert(jQuery(".menuLevel2").position().left);
    var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
    var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
    
    if (jQuery.browser.msie && (ie55 || ie6)) {
        if (jQuery("#col2").height() < jQuery("#col1").height()) {
        
            jQuery("#col2_content_2").css("height", jQuery("#col1").height() - jQuery("#col2_content_1").height() - 486);
            
        }
        else {
            jQuery("#col2_content_2").css("height", jQuery("#col1").height() - (jQuery("#col2_content_1").height()) - 490);
            
        }
    }
    else {
        if (jQuery("#col2").height() < jQuery("#col1").height()) {
        
            jQuery("#col2_content_2").css("height", jQuery("#col1").height() - jQuery("#col2_content_1").height() - 18);
            
        }
        else {
            jQuery("#col2_content_2").css("height", jQuery("#col1").height() - (jQuery("#col2_content_1").height()) - 22);
            
        }
    }
    
    
    
});




jQuery(window).bind('resize', function(){

    if (jQuery(document).width() < 954) {
        jQuery("body").css("background-image", "url('fileadmin/img/dreambowl/bg_body2.jpg')");
        jQuery("body").css("background-position", "0px 0px");
        
        
    }
    else {
        jQuery("body").css("background-image", "url('fileadmin/img/dreambowl/bg_body3.jpg')");
        jQuery("body").css("background-position", "center top");
    }
    
    
    
});



function showNewsPic(id, anzahl, idPic, act){


    for (i = 0; i < anzahl; i++) {
        xx = document.getElementById('imgNewsHead' + i);
        xx.style.display = 'none';
        xy = document.getElementById('imgNewsHeadPic' + i);
        if (i == 0) 
            xy.src = 'fileadmin/img/news/imgNewsNo1.jpg';
        if (i == 1) 
            xy.src = 'fileadmin/img/news/imgNewsNo2.jpg';
        if (i == 2) 
            xy.src = 'fileadmin/img/news/imgNewsNo3.jpg';
        if (i == 3) 
            xy.src = 'fileadmin/img/news/imgNewsNo4.jpg';
        if (i == 4) 
            xy.src = 'fileadmin/img/news/imgNewsNo5.jpg';
        if (i == 5) 
            xy.src = 'fileadmin/img/news/imgNewsNo6.jpg';
        if (i == 6) 
            xy.src = 'fileadmin/img/news/imgNewsNo7.jpg';
        if (i == 7) 
            xy.src = 'fileadmin/img/news/imgNewsNo8.jpg';
        if (i == 8) 
            xy.src = 'fileadmin/img/news/imgNewsNo9.jpg';
        if (i == 9) 
            xy.src = 'fileadmin/img/news/imgNewsNo10.jpg';
    }
    
    el = document.getElementById(id);
    if (el.style.display == 'none') {
        el.style.display = '';
        
    }
    
    zz = document.getElementById(idPic);
    if (act == 0) 
        zz.src = 'fileadmin/img/news/imgNewsAct1.jpg'
    if (act == 1) 
        zz.src = 'fileadmin/img/news/imgNewsAct2.jpg'
    if (act == 2) 
        zz.src = 'fileadmin/img/news/imgNewsAct3.jpg'
    if (act == 3) 
        zz.src = 'fileadmin/img/news/imgNewsAct4.jpg'
    if (act == 4) 
        zz.src = 'fileadmin/img/news/imgNewsAct5.jpg'
    if (act == 5) 
        zz.src = 'fileadmin/img/news/imgNewsAct6.jpg'
    if (act == 6) 
        zz.src = 'fileadmin/img/news/imgNewsAct7.jpg'
    if (act == 7) 
        zz.src = 'fileadmin/img/news/imgNewsAct8.jpg'
    if (act == 8) 
        zz.src = 'fileadmin/img/news/imgNewsAct9.jpg'
    if (act == 9) 
        zz.src = 'fileadmin/img/news/imgNewsAct10.jpg'
}


jQuery(document).ready(function(){
    jQuery(document).pngFix();
});
