
$(document).ready(function() {
						   
	$('body').append('<div id="overlay"></div>');
	
	$('ul.prodType').css({display:'block'});
	//$('.wrap_view:not(:first)').hide();
	$('.wrap_view').appendTo('body').css({display:'none',float:'none',position:'absolute',zIndex:'10000'}).children('.inn_prod');//.prepend('<a class="closebtn"></a>');
	//$('.prodType a:first').addClass('act');
	
	$('ul.prodType a, .needhelp').click(function () {
		//$('ul.prodType a').removeClass('act');
		//$(this).addClass('act');
		
		h = $(document).height();
		$('#overlay').css({height:h+'px',display:'block'});
		
		var bodyId = $(this).attr('href');
		var body = $(bodyId);
		if (body.height()>=$(window).height()) body.height($(window).height()*0.8).find('.scroll').css({height:(body.height()-100)+'px',overflowY:'scroll'});
		l = ($('body').width()/2)-(body.width()/2);
		t = $(window).scrollTop() + ( ( $(window).height()-body.height() ) / 2 );
		//$('.wrap_view:visible').filter(':not(' + bodyId + ')').fadeOut('fast', function () {
		body.css({left:l+'px',top:t+'px'}).fadeIn('fast');
		//});
		
		return false;
	});
	
	$('#overlay').click(function(){
		$(this).css({display:'none'});
		$('.wrap_view').fadeOut('fast');
	});
	
	$('.closebtn').css({cursor:'pointer'}).click(function(){
		$('#overlay').css({display:'none'});
		$(this).parent().parent().fadeOut('fast');
	});
	
	//$('.prod_more').hide();
	/*
	$('a.readMore').click(function () {
		$(this).parents('.prod_body').next('.prod_more').toggle();		
		return false;
	});
	*/
	
	$('a.expand, a.expanded').click(function (event){
		
		event.preventDefault();
		
		$(this).attr('class',$('#div_'+this.id).is(':visible') ? 'expand' : 'expanded')
		
		$('div#div_'+this.id).toggle("slow");
		
	});
	
});


