/* -------------------------------------------------- *
 * Project scripts
 * -------------------------------------------------- *
 * Author: Morozov Igor
 * URL: http://www.morozoff.info/
 * Copyright: 2010 Morozov Igor
** -------------------------------------------------- */

$(document).ready(function() {
	if($('a.c-color').length > 0) {
		$('a.c-color').click(function(event) {
			$('.overlay').show();
			$(this).next().show().css({left:($(this).offset().left+35)+'px',top:($(this).offset().top)+'px'})
			return false;
		});
		$('.b-color-filter a').bind('mouseover mouseout', function(event) {
			evt = event.type
			$t = $(this);
			$color = $t.parents('.pp-colors-i').find('.color-hd');
			if(evt == 'mouseover') {
				$color.html($t.attr('title'));
			}
			else {
				$color.html('');
			}
		});
	}
	$('a.advertisement').click(function() {
		
		var left = (window.width/2)-(300);
		var top = (window.height/2)-(200);
		
		$('.overlay').show();
		$(this).next().show().css({left:(left) + 'px',top:(top)+'px',position:'relative',overflow:'auto',zIndex:'9993'});
		//$(this).next().parents('.logo').css.zIndex = 9994;
		
		//$(this).css.zIndex = 9994;
		//$(this).next().css.zIndex = 9993;
		
		return false;
	});
	
	$('.overlay').click(function() {
		$('.overlay').hide();
		if($('.pp-colors').length > 0) {
			$('.pp-colors').hide();
		}
		
		$('.advimage').hide();
		
		return false;
	});
	$('.advimage').click(function() {
		$('.advimage').hide();
		$('.overlay').hide();
		return false;
	});
	$(".b-navigation").superfish({
		animation: {height:'show'},
		speed: 300
	});
	$(".b-color-filter a").bind("click", function() {
				
        });
});

