var linksEnabled = true;

jQuery(document).ready(function(){
	jQuery(":text,textarea").focus(function(){
		jQuery(this).parent().addClass("currentFocus");
		jQuery(".currentFocus .desc").css({"color" : "#ff5a00"});
		jQuery(".currentFocus .message_input, .currentFocus #author, .currentFocus #email, .currentFocus #url").css({"border-color" : "#ff5a00", "color" : "#000"});
	});

	jQuery(":text,textarea").blur(function(){
		jQuery(this).parent().removeClass("currentFocus");
		jQuery(".message_input, .desc, #author, #email, #url").removeAttr("style");
	});
	
	/*dropdown menu 20090805*/
	jQuery("div#main_navi ul.left li").hover(
		function(){jQuery("ul", this).css("display", "block");},
		function(){jQuery("ul", this).css("display", "none");}
	);
	
	//Thumbnails rollover
	jQuery("ul.thumbs li").hover(function() {
		jQuery(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
		jQuery(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
			.animate({
				marginTop: '-30px', /* The next 4 lines will vertically align this image */ 
				marginLeft: '-30px',
				top: '0%',
				left: '0%',
				width: '200px', /* Set new width */
				height: '200px', /* Set new height */
				padding: '20px'
			}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */
	} , function() {
		jQuery(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
		jQuery(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
			.animate({
				marginTop: '0', /* Set alignment back to default */
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '180px', /* Set width back to default */
				height: '180px', /* Set height back to default */
				padding: '0px'
			}, 300);
	});
	

 	//Menu rollover (preload)
 	jQuery("div#sidebar ul li a img:not(.active)").preload({
 		find: '_off.gif',
 		replace: '_on.gif'
 	});
 	
 	//Menu rollover (:active)
 	/*jQuery("div#sidebar ul li a img.active").each(function(){
 		activeSrc = this.src.substr(0, this.src.length - 7) + 'active.gif';
 		this.src = activeSrc;
 	});*/
 	
 	//Menu rollover (:hover)
 	jQuery("div#sidebar ul li a img:not(.active)").hover(
 		function(){
 			var newSrc = this.src.substr(0, this.src.length - 7) + 'on.gif';
			this.src = newSrc;
 		},
 		function(){
			var oldSrc = this.src.substr(0, this.src.length - 6) + 'off.gif';
			this.src = oldSrc;
 		}
 	);
 	
 	//Rounded corners on search box
  	jQuery("form#searchform div#nested").corner({
			  tl: { radius: 2 },
			  tr: { radius: 2 },
			  bl: { radius: 2 },
			  br: { radius: 2 }}
	);
	
	//Thumbs Fancybox
	jQuery("a.thumb_payware").fancybox();
	
	//Thumbs Hover
	jQuery("a.thumb_payware img").hover(function(){
		jQuery(this).animate({opacity: 0.6}, 150);
		jQuery(this).animate({opacity: 1}, 500);
	});

});
