/** BEGIN settings **/
var searchDefault = 'Enter search keywords here...'; // Default text of the search input
var searchColor = '#ffffff'; // Color of text when focused
/** END settings **/



/** BEGIN global varibales **/
var obj = null;
/** END global variables **/

/** BEGIN user-defined functions **/
function checkHover() {
	if (obj) obj.find('ul').fadeOut('fast');
}
/** END user-defined functions **/

/** BEGIN jQuery actions **/
jQuery(function() {
	
	/** begin submenu **/
	jQuery('#header ul > li').hover(
		function() {
			if (obj) {
				obj.find('ul')
					.css('display', 'none');
				obj = null;
			}
			jQuery(this).find('ul')
				.fadeIn();
		},
		function() {
			obj = jQuery(this);
			setTimeout("checkHover()", 1000);
		}
	);
	/** end submenu **/
	
	/** begin search form **/
	jQuery('#s').attr({ 'value' : searchDefault });
	jQuery('#s').focus(function() {
		var temp = jQuery(this).attr('value');
		color = jQuery(this).css('color');
		jQuery(this).css({ 'color' : searchColor });
		if (temp==searchDefault)
			jQuery(this).attr({ 'value' : '' })
	});
	jQuery('#s').blur(function() {
		if (jQuery(this).attr('value')=='') {
			jQuery(this).attr({ 'value' : searchDefault });
		}
		jQuery(this).css({ 'color' : color });
	});
	/** end search form **/
	
	/** begin thumbnails **/
	var tempBoxH = jQuery('.thumb .buffer').height();
	var tempImgH = jQuery('.thumb .buffer img').height();
	var tempH = (tempImgH - tempBoxH)/2;
	jQuery('.thumb .buffer img').css('margin-top', '-'+tempH+'px');
	/** end thumbnails **/
	
	/** begin footer divs **/
	var tempFootH = jQuery('#footer').height();
	jQuery('#footer div').height(tempFootH-100);
	/** end footer divs **/
	
	/** begin images hover **/
	jQuery('#content a img, #sidebar a img').animate({ 'opacity' : 0.8 });
	jQuery('#content a img, #sidebar a img').hover(
		function() {
			jQuery(this)
				.stop()
				.animate({ opacity : 1 })
		},
		function() {
			jQuery(this)
				.stop()
				.animate({ 'opacity' : 0.8 })
		}
	)
	tempBorder = jQuery('.thumb').css('border-color');
	/** end images hover **/
	
	/** begin lightbox post images **/
	jQuery('#content .content img').parent().attr({ 'rel' : 'lightbox[blah]' });
	/** end lightbox post images **/
	
});
/** END jQuery actions **/
