
$(document).ready(function() {

	
	$(".tab_content").hide(); 
	$("ul.tabs li:first").addClass("active").show(); 
	$(".tab_content:first").show();
	
	
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); 
		$(this).addClass("active"); 
		$(".tab_content").hide(); 
		var activeTab = $(this).find("a").attr("href"); 
		$(activeTab).fadeIn(); 
		return false;
	});

});

//price popup


				$(document).ready(function() {
$('a.poplight[href^=#]').click(function() {
    var popID = $(this).attr('rel'); 
    var popURL = $(this).attr('href'); 
    var query= popURL.split('?');
    var dim= query[1].split('&');
    var popWidth = dim[0].split('=')[1]; 
    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) });
    var popMargTop = ($('#' + popID).height() + 80) / 2;
    var popMargLeft = ($('#' + popID).width() + 80) / 2;
    $('#' + popID).css({
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });
    $('body').append('<div id="fade"></div>'); 
   
});
$('a.close, #fade').live('click', function() { 
    $('#fade , .popup_block').fadeOut(function() {
        $('#fade').remove();  
    });
    $('#fade , .popup_block2').fadeOut(function() {
        $('#fade').remove();  
    });
    return false;
});
});
