jQuery.noConflict();

jQuery(document).ready(function(){
	if(jQuery(window).width() >= 800 && jQuery(window).width() <= 1600) {
		jQuery("#content-box").css("height",(jQuery(window).height()-203-10+2)+"px");
		jQuery("#content-box-content-box").css("height",(jQuery(window).height()-244-22+2)+"px");
		jQuery("#content-box-content-box").css("width",(jQuery(window).width()-248-21)+"px");
		jQuery(".content-text").css("width",(jQuery(window).width()-245)+"px");
		jQuery(".content-text").css("height",(jQuery(window).height()-280-10-10+2)+"px");
		jQuery(".content-header").css("width",(jQuery(window).width()-223-21)+"px");
		jQuery("#navigation-it-box").css("width","100%");
		jQuery("#navigation-dev-box").css("width","100%");
		jQuery("#teaser-box").css("width","100%");
		jQuery("#header-box").css("width","100%");
	}else if(jQuery(window).width() < 800) {
		jQuery("#content-box").css("height",(jQuery(window).height()-203-10+2)+"px");
		jQuery("#content-box-content-box").css("height",(jQuery(window).height()-244-22+2)+"px");
		jQuery("#content-box-content-box").css("width",(800-248-21)+"px");			
		jQuery(".content-text").css("width",(800-245)+"px");
		jQuery(".content-text").css("height",(jQuery(window).height()-280-10-10+2)+"px");
		jQuery(".content-header").css("width",(800-223-21)+"px");					
		jQuery("#navigation-it-box").css("width","800px");
		jQuery("#navigation-dev-box").css("width","800px");
		jQuery("#teaser-box").css("width","800px");
		jQuery("#header-box").css("width","800px");
	} else {
		jQuery("#content-box").css("height",(jQuery(window).height()-203-10+2)+"px");
		jQuery("#content-box-content-box").css("height",(jQuery(window).height()-244-22+2)+"px");
		jQuery("#content-box-content-box").css("width",(1440-248-21)+"px");
		jQuery(".content-text").css("width",(1440-245)+"px");
		jQuery(".content-text").css("height",(jQuery(window).height()-280-10-10+2)+"px");
		jQuery(".content-header").css("width",(1440-223-21)+"px");
		jQuery("#navigation-it-box").css("width","100%");
		jQuery("#navigation-dev-box").css("width","100%");
		jQuery("#teaser-box").css("width","100%");
		jQuery("#header-box").css("width","100%");				
	}
	
	jQuery("li a").each(function(){
		var link = jQuery(this).attr('href');
		jQuery(this).parent().click(function(){
			//alert("");
			window.open(link, "_self");
			
		});
	});


	jQuery(window).resize(function(){
		if(jQuery(window).width() >= 800 && jQuery(window).width() <= 1600) {
			jQuery("#content-box").css("height",(jQuery(window).height()-203-10+2)+"px");
			jQuery("#content-box-content-box").css("height",(jQuery(window).height()-244-22+2)+"px");
			jQuery("#content-box-content-box").css("width",(jQuery(window).width()-248-21)+"px");
			jQuery(".content-text").css("width",(jQuery(window).width()-245)+"px");
			jQuery(".content-text").css("height",(jQuery(window).height()-280-10-10+2)+"px");
			jQuery(".content-header").css("width",(jQuery(window).width()-223-21)+"px");
			jQuery("#navigation-it-box").css("width","100%");
			jQuery("#navigation-dev-box").css("width","100%");
			jQuery("#teaser-box").css("width","100%");
			jQuery("#header-box").css("width","100%");
		}else if(jQuery(window).width() < 800) {
			jQuery("#content-box").css("height",(jQuery(window).height()-203-10)+"px");
			jQuery("#content-box-content-box").css("height",(jQuery(window).height()-244-22)+"px");
			jQuery("#content-box-content-box").css("width",(800-248-21)+"px");			
			jQuery(".content-text").css("width",(800-245)+"px");
			jQuery(".content-text").css("height",(jQuery(window).height()-280-10-23)+"px");
			jQuery(".content-header").css("width",(800-223-21)+"px");
			jQuery("#navigation-it-box").css("width","800px");
			jQuery("#navigation-dev-box").css("width","800px");
			jQuery("#teaser-box").css("width","800px");
			jQuery("#header-box").css("width","800px");
		}
	});
	
	window.setInterval(function(){
		if(jQuery(window).width() >= 800 && jQuery(window).width() <= 1600) {
			jQuery("#content-box").css("height",(jQuery(window).height()-203-10+2)+"px");
			jQuery("#content-box-content-box").css("height",(jQuery(window).height()-244-22+2)+"px");
			jQuery("#content-box-content-box").css("width",(jQuery(window).width()-248-21)+"px");			
			jQuery(".content-text").css("width",(jQuery(window).width()-245)+"px");
			jQuery(".content-text").css("height",(jQuery(window).height()-280-10-10+2)+"px");
			jQuery(".content-header").css("width",(jQuery(window).width()-223-21)+"px");
			jQuery("#navigation-it-box").css("width","100%");
			jQuery("#navigation-dev-box").css("width","100%");
			jQuery("#teaser-box").css("width","100%");
			jQuery("#header-box").css("width","100%");
		} else if(jQuery(window).width() < 800) {
			jQuery("#content-box").css("height",(jQuery(window).height()-203-10+2)+"px");
			jQuery("#content-box-content-box").css("height",(jQuery(window).height()-244-22+2)+"px");
			jQuery("#content-box-content-box").css("width",(800-248-21)+"px");			
			jQuery(".content-text").css("width",(800-245)+"px");
			jQuery(".content-text").css("height",(jQuery(window).height()-280-10-10+2)+"px");
			jQuery(".content-header").css("width",(800-223-21)+"px");					
			jQuery("#navigation-it-box").css("width","800px");
			jQuery("#navigation-dev-box").css("width","800px");
			jQuery("#teaser-box").css("width","800px");
			jQuery("#header-box").css("width","800px");
		}
	},100);
	
	
	// Slideshow
//	jQuery("div#mygalone").slideView();
	if(!(jQuery.browser.msie && jQuery.browser.version < 8)) {
		jQuery(window).bind("load", function() {
			var gallerycount = 0;
			jQuery(".csc-textpic-imagewrap").each(function(){
				if(!jQuery(this).hasClass("rgslideshowce")) {
					gallerycount++;
					var bilderliste = new Array();
					jQuery(this).find("li.csc-textpic-image").each(function(){
						bilderliste.push(jQuery(this).children("img").attr("src"));
					});
					
					// Slider nur erstellen, wenn mehr als ein Bild in Liste vorhanden
					if(bilderliste.length > 1) {
						var i = 0;
						var galleryID = "slider_gallery"+gallerycount;
				
						var output = "";
						output += "<div style=\"position:relative;left:0px;top:0px;\">";
						output += "<div id=\""+galleryID+"\" class=\"\"><ul>";
						for(i; i < bilderliste.length; i++) {
							output+="<li>";
							output+="<img src=\""+bilderliste[i]+"\">";
							output+="</li>";
						}
						output += "</ul></div>";
						jQuery(this).html(output);
						jQuery("div#"+galleryID).slideView();
						output += "</div>";
						jQuery(this).parent().append("<div style=\"clear:both;\"></div>");
					}
				}
			});
		});
	}
});



