jQuery(document).ready(function() {
	if(jQuery.browser.msie && jQuery.browser.version < 9) {
		jQuery.getScript("http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js", function() {
			jQuery(".ie7_anon").each(function() {
				if (!jQuery(this).parent("a").hasClass("anchor")) {
					jQuery(this).html("&rsaquo;");
				}
			});
		});
		if(jQuery.browser.version < 8){
			jQuery('.text .button:first-child').css({'margin-left': '-15px'});
			
			/* Fix für gleiche Höhe von Links im Footer */
			var youtubePos = jQuery('.social li.text').offset();
			var twitterPos = jQuery('.social li.text').next().offset();
			var facebook = jQuery('.social li#facebook').offset(); 
			var kontaktPos = jQuery('.contactLink').offset();
			if(kontaktPos.top!=youtubePos.top){
				jQuery('.social li.text').offset({ top: kontaktPos.top});
				jQuery('.social li.text').next().offset({ top: kontaktPos.top});
				jQuery('.social li#facebook').offset(facebook); 
			}
			
			/* Fix für Katalog durchblättern */
			if(('#LOE_CatalogueForm .bigBox').length > 0){
				jQuery('#LOE_CatalogueForm .bigBox label').each(function(key,value){
					if(jQuery(this).siblings('.catalogueObj').length > 0){
						var labelY = jQuery(this).offset().top + parseInt(jQuery(this).css('padding-top'));
						var catalogueObjY= jQuery(this).siblings('.catalogueObj').offset().top + parseInt(jQuery(this).css('padding-top'));
						if(labelY!=catalogueObjY){
							jQuery(this).siblings('.catalogueObj').offset({top: labelY});
						}
					}
				});
			}
		}
	}
	

	if (window.getComputedStyle) {
		var links = document.getElementsByTagName("a");
		for (var i = 0; i < links.length; i++) {
			var link = links[i];
			var lClass = link.className.split(" ");

			if (lClass.length > 1) {
				lClass = lClass[1];

				if (lClass == "imagebutton") {
					var styles = document.styleSheets;
					for (var j = 0; j < styles.length; j++) {
						var style = styles[j];
						var src = style.href.split("/");
						var name = src[src.length - 1];

						if (name == "screen.css") {
							var selector = "div#EntertainmentInfo div.entertainmentInfo a.imagebutton:before";
							var rule = link.parentNode.getAttribute("style");

							if (style.addRule) {
								style.addRule(selector, rule);
							} else {
								style.insertRule(""+selector+" { "+rule+" }", style.cssRules.length);
							}

							link.parentNode.removeAttribute("style");
							break;
						}
					}
				}
			}
		}
	}
});
