// JavaScript Document
$(document).ready(function(){
	// Hover effect on products
	$('.productCell').mouseenter(function(){
		$(this).css('background','#EFEFEF');
	})
	
	$('.productCell').mouseleave(function(){
		$(this).css('background','#ffffff');
	})
	
	// error bubble
	$(function(){
   	  opts = {
		  distances : [5,0],
		  leftShifts : [0,0],
		  bubbleTimes : [400,400],
		  hideDelays : [0,0],
		  bubbleWidths : [300,100],
		  bubbleImagesPath : "include/js/bubble/images/skins/classic",
		  msieFix : true
   		};
   		$('.coda_bubble').codaBubble(opts);
    })
	
	 $('.popup')
	 	.unbind('mouseover')
		.unbind('mouseout')
		.unbind('mouseenter')
		.unbind('mouseleave')
	
	$('#joinNewsLetterButton').click(function(){	
		if($('#joinNewsLetter').val().length > 0 && $('#joinNewsLetter').val().search("@") >=0){
			$('#joinNewsLetterForm').trigger('submit');
		}else{
			$('#joinNewsLetterTrigger').trigger('mouseover');		
		}
		return false;			
	})
	
	$('#joinNewsLetterForm').submit(function(){	
		if($('#joinNewsLetter').val().length > 0 && $('#joinNewsLetter').val().search("@") >=0){
			
		}else{
			$('#joinNewsLetterTrigger').trigger('mouseover');		
			return false;
		}
					
	})
	
	$('#joinNewsLetter').focus(function(){
		$('#joinNewsLetterTrigger').trigger('mouseout');		
	});
	
	$('#searchButton').click(function(){
		$('#searchSite').trigger('submit');
		return false;
	})
	
	$('.designers ul a').click(function(){
		return false;	
	})
	
	$('.press li img').each(function(){
		$(this).tipsy({gravity: 's'});
	})
});
