$(function(){
	
    // accordion
    $('.accordion .content').hide();
    $('.accordion:first .content').show();
    $('.accordion:first').addClass('active');
    $('.accordion h4').click(function(){
        // active toggle
        if ($(this).parent().hasClass('active')) {
            $(this).parent().removeClass('active');
        } else {
            // check others for active and close
            $('.accordion.active .content').slideUp('fast');
            $('.accordion.active').removeClass('active');
            $(this).parent().addClass('active');
        }
        $(this).parent().find('.content').slideToggle('fast');
    });
	//IE only	
$(document).ready(function() {
    if ($.browser.msie) {
		//curvey corners
    	$('.filter .cc').corner({
    		tl: { radius: 5 }, tr: { radius: 5 }, bl: { radius: 5 }, br: { radius: 5 }, antiAlias: true 
    	});
    	$('.tout .cc').corner({
    		tl: { radius: 3 }, tr: { radius: 3 }, bl: { radius: 3 }, br: { radius: 3 }, antiAlias: true
    	});
    	$('#content').corner({
    		tl: { radius: 10 }, tr: { radius: 3 }, bl: { radius: 10 }, br: { radius: 3 }, antiAlias: true 
    	});
    	$('#side-col .cc').corner({
    		tl: { radius: 3 }, tr: { radius: 10 }, bl: { radius: 3 }, br: { radius: 10 }, antiAlias: true 
    	});
    	$('.btn').corner({
    		tl: { radius: 3 }, tr: { radius: 3 }, bl: { radius: 3 }, br: { radius: 3 }, antiAlias: true 
    	});
    	
    	new_width = parseInt($('#content').css('width')) + 20;
    	$('#content').css('width',new_width);
    	
    	$('#submenu ul').css('width','215px');
    	$('#side-col .cc').css('margin','0 0 40px 0');
    	$('.filter .cc').css('margin-top','19px');
    	$('.error .full_width').css('margin-top','15px');
    	$('#submenu,#accordion').css('width','227px');    	 	
		//equal heights and margin fix
		if (parseInt( $('#side-col').height() ) > parseInt ( $('#content').height() ) ){
			$('#content').css('height', parseInt($('#side-col').height()) - 40);
			$("#page_tools").css("margin-top","0px");
	    };
	    if ($.browser.msie && jQuery.browser.version.substr(0,1)=="7"){
	    	$('.yousearched').css('padding-top','0');
	    };
		//margin fix
	    if (parseInt( $('#side-col').height() ) < parseInt ( $('#content').height() ) ){
	    	$("#page_tools").css("margin-top","40px");
	    };
		//vertical align center hack 
	    $(".box-in .text a,.box-ex .text a").addClass("iefix1");
		$(".box-in .text span,.box-ex .text span").addClass("iefix2");
	} else {
		//all other browsers equal height		
		if (parseInt( $('#side-col').height() ) > parseInt ( $('#content').height() ) ){
			$('#content').css('height', parseInt($('#side-col').height()) - 26);
	    };
	};
});
    if ($.browser.opera) {
		//filter btn
    	$('.filter .cc').css('margin-top','15px');
	};
	//listing link to parent level
	$(".listing li,#content .box-in").live("click",function() {
		self.location = $(this).find('a').attr("href");
	});
	//listing link to parent level
	$("#content .box-ex").live("click",function() {
		window.open($(this).find('a').attr("href"));
		return false;
	});
});

