/*----------------------------------------------------------------------
[Global JavaScript ] 
Desc: site wide javascript

Copyright:		Adam Foster 2010
Project:		
Created by:		Adam Foster
Last Updated:	13 - 07 - 10			
-----------------------------------------------------------------------*/

/* Not looking for any trouble here -----------------------------------*/

var $j = jQuery.noConflict();
$ie = false;

/* When the dom is ready... -------------------------------------------*/

$j(document).ready(function() {
	
	if($j.browser.msie) $ie = true;
	$j('body').addClass('js');
	selectMenus();
	tags();
	
});

function selectMenus(){
		
	$j('.select').each(function(){
		
		var ul = $j(this).find('ul');
		$j(this).hover(
			function () { ul.show(); },
			function () { ul.hide(); }
		);
	
	});
	
};

function tags(){
	
	$j('.postMeta').each(function(){
		
		var ul = $j(this).find('.tags');
			ul.hide();
		var trigger = $j(this).find('p.left a');
		
		trigger.addClass('close')
			.click(function(e){
				e.preventDefault();
				ul.toggle();
				trigger.toggleClass('close');
			});
		
	});
};

/* When the dom is ready... -------------------------------------------*/

function clearText(thefield){
	if (thefield.defaultValue==thefield.value) thefield.value = "";
};
function replaceText(thefield){
	if (thefield.value == "") thefield.value = thefield.defaultValue;
};
