jQuery(document).ready(function() {
	
	jQuery('#globalContent TD').supersleight({shim: '/theme/images/x.gif'});
	jQuery("BODY").addClass(jQuery.client.os.toLowerCase());

	Cufon.replace('#claim, h3, .compatil, #history .yearActive', { fontFamily: 'CompatilLetter LT' });		
	Cufon.replace('.headline A', { fontFamily: 'CompatilLetter LT', hover: true });


	
	$(".bigtable tr:not(.highlightBottom), .smalltable tr, .calendar table tr, .analystenresearch table tr, .eventscalendar table tr").hover(
		function(){ $(this).addClass("hover"); },
		function(){ $(this).removeClass("hover"); }
	);	

	jQuery("dfn").click(function () {
		var spanChildren = $(this).children('span');
		if(spanChildren.length > 0){
			$(spanChildren).remove(); 
		} else {
			$(this).append('<span class="dfn"><span class="infoWindow"><span class="infoWindowContent"><span class="title">' + $(this).text() + '</span><span class="text">' + $(this).attr("title") + '</span></span></span></span>');
		}
	});

	jQuery('#global').click( function(){
		$(this).siblings('#globalContent').toggle();
		$(this).toggleClass('open');
	});

	jQuery('.boxShadow .close').click( function(){
		jQuery(this).parents('.boxShadow').hide();
		//$('#global').removeClass('open');
		return false;
	});
	
	jQuery('.pressImage .showDetail').click(function() {
		jQuery('#' + jQuery(this).attr('rel')).css('display', 'block');
		return false;
	});

	jQuery('a[rel="external"]').click( function() {
    window.open(jQuery(this).attr('href'));
    return false;
  });

  jQuery('a[rel="tracking"]').click( function() {
    try {
    var pageTracker = _gat._getTracker(trackerId);
    pageTracker._trackPageview(jQuery(this).attr('href'));
    } catch(err) {}
  });
	
	jQuery('.clearInput').clearInput();
	
	jQuery('.frontend .accordion').accordion({ active: true, collapsible: true });
	
	jQuery(".styleSelect").sSelect();
	
	jQuery("FORM #buttonSubmit").click( function(){
		jQuery(this).parents("FORM").submit();																										
	});
	
	jQuery("FORM #inputSubmit").hide();
	jQuery("FORM #buttonSubmit").css("display", "inline");


});

jQuery.fn.clearInput = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};



