function swap_img(img)
{
$('#main_img').attr({ 
  src: img
});
}

$(document).ready(function()
{
	
	$('#search-box').focus(function() { 
		this.value = "";
		$(this).css({color:"#000"});
		$(this).animate({borderLeftColor:"#8EAA3D",borderRightColor:"#8EAA3D",borderTopColor:"#8EAA3D",borderBottomColor:"#8EAA3D"},200);
	});
	
	$('#search-box').blur(function() { 
		$(this).animate({color:"#999"}, 200);
		$(this).animate({borderLeftColor:"#ccc",borderRightColor:"#ccc",borderTopColor:"#ccc",borderBottomColor:"#ccc"},200);
	});
	
	$('#location').click(
	function()
	{
		if($('#popup').css('display')!='block')
		{
			$('#popup').css({zIndex:600});
			$('#popup').fadeIn(400);
			$(this).animate({backgroundColor:"#000",color:"#fff"}, 300);
			//$('#close-location').animate({backgroundColor:"#000",color:"#fff"}, 2);
			//$('#close-location').fadeIn(300);
		} else {
			$('#popup').fadeOut(400);
			$('#location').animate({backgroundColor:"#eee",color:"#999"}, 300);
			//$(this).fadeOut(200);
		}
	});
    
	$('#close-location').click(
	function()
	{
		$('#popup').fadeOut(400);
		$('#location').animate({backgroundColor:"#eee",color:"#999"}, 300);
		$(this).fadeOut(200);
		
	});
	
	$('#location').hover(
	function ()
	{
		if($('#popup').css('display')!='block')
		{
			$(this).animate({backgroundColor:"#f86f1a",color:"#fff"}, 300);
		}
	},
	function ()
	{
		if($('#popup').css('display')!='block')
		{
			$(this).animate({backgroundColor:"#eee",color:"#999"}, 300);
		}
	});
	
	$('#additional_images li img').click(
	function()
	{
		$('#additional_images li img').animate({borderLeftColor:"#eee",borderRightColor:"#eee",borderTopColor:"#eee",borderBottomColor:"#eee"}, 200);
		
		$(this).animate({borderLeftColor:"#999",borderRightColor:"#999",borderTopColor:"#999",borderBottomColor:"#999"}, 200);
		
		//$(this).parent().remove();
		//alert($(this).parent());
	});
	
	/*$('#additional_images li a img').hover(
	function ()
	{
	$(this).animate({borderLeftColor:"#999",borderRightColor:"#999",borderTopColor:"#999",borderBottomColor:"#999"}, 200);
	},
	function ()
	{
	$(this).animate({borderLeftColor:"#eee",borderRightColor:"#eee",borderTopColor:"#eee",borderBottomColor:"#eee"}, 200);
	}); */
	
	$('#browse-by-list li a.inactive').hover(
	function ()
	{
	$(this).animate({backgroundColor:"#f86f1a",color:"#fff"}, 300);
	},
	function ()
	{
	$(this).animate({backgroundColor:"#eee",color:"#999"}, 300);
	});
	
	$('#nominee_tools a').hover(
	function ()
	{
	$(this).animate({backgroundColor:"#f86f1a",color:"#fff"}, 300);
	},
	function ()
	{
	$(this).animate({backgroundColor:"#000",color:"#ccc"}, 300);
	});
	
	$('#nominate-a-design a').hover(
	function ()
	{
	$(this).animate({backgroundColor:"#000",color:"#fff"}, 300);
	},
	function ()
	{
	$(this).animate({backgroundColor:"#f86f1a",color:"#fff"}, 300);
	});
	
		
	$('#browse-nominees li').hover(
	function ()
	{
		//$('#popup').fadeOut(400);
		$('.blue-border',this).css({zIndex:150});
		$('.blue-border',this).fadeIn(200);
		if($('.more-info-html-left',this))
		{
			$('.more-info-html-left',this).css({zIndex:149});
			$('.more-info-html-left',this).fadeIn(200);
			$('.more-info-html-left',this).animate({marginLeft: '-227px'},100);
		} 
			$('.more-info-html',this).css({zIndex:149});
			$('.more-info-html',this).fadeIn(200);
			$('.more-info-html',this).animate({marginLeft: '150px'},100);
		
	},
		function ()
	{
		$('.blue-border',this).css({zIndex:100});
		$('.blue-border',this).fadeOut(200);
		if($('.more-info-html-left',this))
		{
			$('.more-info-html-left',this).css({zIndex:99});
			$('.more-info-html-left',this).animate({marginLeft: '-222px'},15);
			$('.more-info-html-left',this).fadeOut(25);
		}
			$('.more-info-html',this).css({zIndex:99});
			$('.more-info-html',this).animate({marginLeft: '145px'},15);
			$('.more-info-html',this).fadeOut(25);
		
	});
});