/*Fonts for the people!!*/
Cufon.replace('h1, h2, h3, .latest-blog, .com-hd'); 
Cufon.replace('#footer h3', { textShadow: '#1e4165 1px 1px' }); 

$(document).ready(function() {
//start

	//Specify jqtransform img folder location
	$('.jselect, .com-btn').jqTransform({imgPath:'css/img/'});


	//form field default values onfocus
	$('form input:text, form textarea').each(function(){
        $.data(this, 'default', this.value);
    }).focus(function(){
        if ($.data(this, 'default') == this.value) {
            this.value = '';
        }
    }).blur(function(){
        if (this.value == '') {
            this.value = $.data(this, 'default');
        }
    });	
    
	//Toggle sub header
	//Courtesy of http://www.bramme.net/2008/09/a-jquery-slider-on-cookies/
			
	// the div that will be hidden/shown
	var panel = $("#sub-head-container");
	//the button that will toggle the panel
	var button = $("div.toggle-link");
	// do you want the panel to start off collapsed or expanded?
	var initialState = "expanded"; // "expanded" OR "collapsed"
	// the class added when the panel is hidden
	var activeClass = "hidden";
	// the text of the button when the panel's expanded
	//var visibleText = "hide";
	// the text of the button when the panel's collapsed
	//var hiddenText = "show";
	
	if($.cookie("panelState") == undefined) {
		$.cookie("panelState", initialState);
	} 
	
	var state = $.cookie("panelState");
	
	if(state == "collapsed") {
		panel.hide();
		//button.text(hiddenText);
		button.addClass(activeClass);
	}
   
	button.click(function(){
		if($.cookie("panelState") == "expanded") {
			$.cookie("panelState", "collapsed");
			//button.text(hiddenText);
			button.addClass(activeClass);
		} else {
			$.cookie("panelState", "expanded");
			//button.text(visibleText);
			button.removeClass(activeClass);
		}
		
		panel.slideToggle("fast");
		
		return false;
	});
	
//end jquery
});
