// JavaScript Document

var $j = jQuery.noConflict();

$j.fn.equalizeHeights = function(){
  return this.height( Math.max.apply(this, $j(this).map(function(i,e){ return $j(e).height() }).get() ) )
}


$j (document).ready(function() {
														 											 											 
	$j('a[rel="external"]').click(function(){ 
		this.target = "_blank";
	});
	
	$j('#carousel').jcarousel({
		scroll: 1,
		auto: 3,
		wrap: "circular",
		animation: "slow"
	});
	
	$j('#top-functions #searchform input#s').watermark('Product Search' , {color: '#44B5E8'});
	$j('.birthdate').watermark('ddmmyyyy');
	$j('#access li li:last-child').addClass('nbottom');
	$j('#access li li:first-child').addClass('ntop');

	$j ('.banner-slide').cycle({
		fx:     'fade', 
		speed:  'slow', 
		timeout: 6000, 
		pager:  '#no-box',
		speed: 1800,
		pause:   true,	
		fit: 0,
    	slideResize: 0
	});
	
	$j(".sub-nav-first .slidey").accordion({ 										 
		event: "click",
		active: true,
		animated: 'slide',
		collapsible: true,
		autoHeight: false
	});
	
	$j(".sub-nav-second.sub_slidey").accordion({ 										 
		event: "click",
		active: true,
		header: '> span',
		animated: 'slide',
		collapsible: true,
		autoHeight: false
	});

if ($j.browser.msie && parseInt($j.browser.version, 10) < 8){
	
} else {

		$j('#wrapper, #tree-wrapper').equalizeHeights();			
		
}

});

$j (window).resize(function() {
														
if ($j.browser.msie && parseInt($j.browser.version, 10) < 8){
	
} else {
		$j('#wrapper, #tree-wrapper').equalizeHeights();	
}

		
});
