$('html').addClass('json');

  function TitleCase(objField) 
        {
            var objValues = objField.split(" ");
            var outText = "";
            for (var i = 0; i < objValues.length; i++) {
                outText = outText + objValues[i].substr(0, 1).toUpperCase() + objValues[i].substr(1).toLowerCase() + ((i < objValues.length - 1) ? " " : "");
            }
            return outText;
        }
		
var citrusCMS = {
		
	load : function() {
		citrusCMS.coreFunctions();
	},
	
		coreFunctions : function(){
			
		Cufon.replace('h1, .mainlist h2, h3');
		Cufon.replace('#leftside a', {hover: {color: '#262563'}});
		
		$('.openWindow').click(function() {window.open(this.href); return false});
		$('.printWindow').click(function() {window.print()});
	
		$('.textform').focus(function() {
			if(this.nodeName != 'SELECT'){
				$('#' + this.id).attr('class', 'textformfocus');
				if (this.value.substr(this.value.length-3,3) == '...') {this.value=''; }
						}
			});
		$('.textform').blur(function(){$('#' + this.id).attr('class', 'textform');});
		
		$('#thumbs').galleriffic();
		
	},
	
	fancybox : function(){
		$('a.viewlarger').fancybox({
			'overlayOpacity'	:	0.7,
			'overlayColor'		:	'#000000'
		});	
		
	}
	
}

$(document).ready(citrusCMS.load);
