
jQuery.noConflict();
// JavaScript Document
jQuery(document).ready(function(){
						   
/*
if (jQuery(".darkRow img").attr("src")="/images/features_yes.gif"){
	jQuery(this).attr(src, "/images/features_yes_grey_bk.gif")
}
*/

jQuery(".comparisonTable tr:odd").addClass("darkRow");







/*
jQuery(".communityToolsList ul li:eq(1) a:last").click(
	  function () {
			jQuery("#GB_window").append('<input id="btnCancel" class="mailButton" type="submit" title="Cancel" value="Cancel" name="btnCancel"/>');
	  });
*/








jQuery(function(){jQuery("#headerLogo, .communityToolsList").pngfix();});



/*
jQuery("tr:not(.darkRow) img").each(function (i) {	
	if (jQuery(this).attr("src") = "/images/features_yes_grey_bk.gif"){
		jQuery(this).attr(src, "/images/features_yes_grey_bk.gif")
	}
});
*/
/*
-----------------------------------------------
/ Equalize height of the Graphic Teasers on the same line
-----------------------------------------------
*/ 

equalizeHeight(".teasers .textTeaser", ".wideTeasersArea", ".teaserWide", ".textTeaser h3", ".textTeaser .textTeaserTxt");
equalizeHeight(".teasers .graphicTeaser", ".wideTeasersArea", ".teaserWide", ".graphicTeaser h2", ".graphicTeaserTxt");
equalizeHeight2Cols(".wideTeasersArea .teaserWide", ".wideTeasersArea", ".teaserWide", ".teaserWide h3", ".teaserWideContent");

function equalizeHeight(placeHolder, container, itemName, itemHeadline, itemBody){
	var placeHolder = placeHolder;
	var container = container;
	var itemName = itemName;
	var itemHeadline = itemHeadline;
	var itemBody = itemBody;

	jQuery(placeHolder).each(function (i) {								
		if ( (i % 3) == 0){
			teaserTitleHeight = jQuery(itemHeadline).eq(i).height();
			if (teaserTitleHeight < jQuery(itemHeadline).eq(i+1).height()){
				teaserTitleHeight = jQuery(itemHeadline).eq(i+1).height();
			}
			if (teaserTitleHeight < jQuery(itemHeadline).eq(i+2).height()){
				teaserTitleHeight = jQuery(itemHeadline).eq(i+2).height();
			}		
			jQuery(itemHeadline).eq(i).height(teaserTitleHeight + "px");
			jQuery(itemHeadline).eq(i+1).height(teaserTitleHeight + "px");
			jQuery(itemHeadline).eq(i+2).height(teaserTitleHeight + "px");
			
			
			teaserBodyHeight = jQuery(itemBody).eq(i).height();
			if (teaserBodyHeight < jQuery(itemBody).eq(i+1).height()){
				teaserBodyHeight = jQuery(itemBody).eq(i+1).height();
			}
			if (teaserBodyHeight < jQuery(itemBody).eq(i+2).height()){
				teaserBodyHeight = jQuery(itemBody).eq(i+2).height();
			}		
			jQuery(itemBody).eq(i).height(teaserBodyHeight + "px");
			jQuery(itemBody).eq(i+1).height(teaserBodyHeight + "px");
			jQuery(itemBody).eq(i+2).height(teaserBodyHeight + "px");

		}

	});

}

function equalizeHeight2Cols(placeHolder, container, itemName, itemHeadline, itemBody){
	var placeHolder = placeHolder;
	var container = container;
	var itemName = itemName;
	var itemHeadline = itemHeadline;
	var itemBody = itemBody;

	jQuery(placeHolder).each(function (i) {								
		if ( (i % 2) == 0){
			teaserTitleHeight = jQuery(itemHeadline).eq(i).height();
			if (teaserTitleHeight < jQuery(itemHeadline).eq(i+1).height()){
				teaserTitleHeight = jQuery(itemHeadline).eq(i+1).height();
			}
			jQuery(itemHeadline).eq(i).height(teaserTitleHeight + "px");
			jQuery(itemHeadline).eq(i+1).height(teaserTitleHeight + "px");
			
			
			teaserBodyHeight = jQuery(itemBody).eq(i).height();
			
			if (teaserBodyHeight < jQuery(itemBody).eq(i+1).height()){
				teaserBodyHeight = jQuery(itemBody).eq(i+1).height();
			}
			if (teaserBodyHeight < 103){
				teaserBodyHeight = 103;
			}
			jQuery(itemBody).eq(i).height(teaserBodyHeight + "px");
			jQuery(itemBody).eq(i+1).height(teaserBodyHeight + "px");

		}

	});

}

jQuery(".compareToProductList").hover(
	  function () {
			jQuery(this).children("ul").css("display", "block");
	  }, 
	  function () {
			jQuery(this).children("ul").css("display", "none");
	  }
);

jQuery(".chooseLanguageList").hover(
	  function () {
			jQuery(this).children("ul").css("display", "block");
	  }, 
	  function () {
			jQuery(this).children("ul").css("display", "none");
	  }
);
	
/*
jQuery(".communityToolsHeader").hover(
  function () {
		jQuery(this).children(".communityToolsSubItem").css("display", "block");
  }, 
  function () {
		jQuery(this).children(".communityToolsSubItem").css("display", "none");
  }
);
*/

jQuery(".chooseLanguage, .communityTools li").hover(
  function () {
		jQuery(this).addClass("hover");
  }, 
  function () {
		jQuery(this).removeClass("hover");
  });

jQuery(".communityTools > ul > li").hover(
  function () {
			jQuery(this).children("ul").parent().addClass("hasChildren");
  }, 
  function () {
		jQuery(".communityTools li").removeClass("hasChildren");
});

  
/*
-----------------------------------------------
/ Equalize height of the Text Teasers on the same line
-----------------------------------------------
*/ 

/*** TABS ***/
/* fixed height for all panels !!! is this needed? */
var tallest = 0;
jQuery('#tabPanels div').each(function(i){
	thisHeight = jQuery(this).height();
	if(thisHeight > tallest) {
		tallest = thisHeight;
		//jQuery(this).height(tallest);
	}
});


/*** end TABS ***/







// if there are less than three teasers on a row, we need to clear the content or it won't take into consideration the .graphicTeaser{margin-bottom: 10px;}
if(jQuery.browser.msie){
     jQuery(".teasers").append('<br style="clear: both; />"');
}

});

