$(document).ready(function() {
		$("#about").prepend($("#HTML").html());
		$("#HTML").html("");
		
		Shadowbox.init();
		$("ul.nav a").click(function(){
			$(this).parent().addClass("on");
		});
			
		
		var pathname = window.location.pathname;
		pathname = pathname.split("/");
		//alert(pathname[1]);
		if (pathname[1] != "")
		{
			$('#'+pathname[1]).css({"background":"#2c2d2e"});
		}
		else
		{
			$('#home').css({"background":"#2c2d2e"});
		}
		
		$('.rating').each(function(index) {
    		$(this).raty({							  
				readOnly:  true,
				start:     $(this).html()
			});		
 		 });
		
		$('#rateme').raty({
			onClick: function(score) {
				$.ajax({
					 url: "/includes/webservices/updateRating.php",    
					 type: "GET",
					 data: "rating="+score+"&id="+$('#brushid').html()+"&type="+pathname[1],
					 cache: false,   
					 success: function (xml) {							
						$('#rateme').html("Thanks!");
						$('#rateme').css({"color":"#666666"});
						
						$('.votecount span').html((parseInt($('.votecount span').html())+1));
					}         
				});
			},
			start: $('#rateme').html()		  				  
		});
		
		
		//$("ul#categories li").hover(function(){
		//	$(this).css({"background":"white"});
		//},
		////	function(){
		//		$(this).css({"background":"url(/images2/navbg.gif)"});
		//	}
		//);				
});



function CreateBookmarkLink() 
{
	title="Brushdirectory.com - Thousands of Adobe Photoshop Brushes"; 
	url="http://www.brushdirectory.com";
	if (window.sidebar) 
	{ 
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} 
	else if( window.external ) 
	{ 
		// IE Favorite
		window.external.AddFavorite( url, title);
	} 
	else if(window.opera && window.print) 
	{ 
		// Opera Hotlist
		return true; 
	}
} 
