$(function() {
	jQuery.httpbase = function( ){
		return $('base')[0].href;
	}
	
	jQuery.loadcm = function( uri, htmlElementId ){
		$.ajax({ url: uri, success: function( data ){
	        $('#' + htmlElementId).html( data );
	    }});
	}	
	
	$(".clickable").click( function() {					
		document.location.href=$('a:eq(0)',this).attr('href');
		return false;
	});

	//SUPPORT
	var values = new Array();
	var inputs = $(":input");
	
	inputs.each(function(i,e) {
		values[i] = e.value;
		if($(e).hasClass("clear")) {
			$(e).focus(function() {			
				if(e.value == values[i]) {				
					e.value = '';
				}
			});
			$(e).blur(function() {
				if(e.value == '') {
					e.value = values[i];
				}
			});
		} else if($(e).is(".password.text")) {
			$(e).focus(function() {		
				$(this).addClass('hide');
				$(this).parent("form").find(".password.input").removeClass('hide');
				$(".password.input",$(this).parent("form")).focus();					
			});			
		} else if($(e).is(".password.input")) {
			$(e).blur(function() {
				if(e.value == '') {
					$(this).addClass('hide');
					$(this).parent("form").find(".password.text").removeClass('hide');
				}
			});
		}
	});
});