Cufon.replace('h2, h3, h4, h5, h6', { fontFamily: 'ah' });
Cufon.replace('#jumpBox h2', { fontFamily: 'ah' ,textShadow: '#f0e3a4 1px 1px'});
Cufon.replace('#jumpBox a.more', { fontFamily: 'ar' ,textShadow: '#eee2a2 1px 1px'});
Cufon.replace('#menu > ul > li > a', { fontFamily: 'ar' });
Cufon.replace('#menu > ul > li.current_page_item > a', { fontFamily: 'ar',color: '#d29304'});
Cufon.replace('#menu > ul > li.current_page_parent > a', { fontFamily: 'ar',color: '#d29304'});
Cufon.replace('#menu > ul > li.current_page_ancestor > a', { fontFamily: 'ar',color: '#d29304'});
Cufon.replace('#sidebar h2, .pagination a', { fontFamily: 'ah' });
Cufon.replace('h1', { fontFamily: 'agr'});
Cufon.replace('.quote, blockquote p', { fontFamily: 'agi'});
Cufon.replace('blockquote strong', { fontFamily: 'agbi'});
jQuery(document).ready(function(){
	jQuery('ul li:first-child').addClass("firstItem");
	jQuery('ul li:last-child').addClass("lastItem");
	var _mw = jQuery('#menu > ul').width();
	//jQuery('#menu > ul').css("width",_mw+"px").hAlign();
	jQuery('#menu > ul > li').addClass("firstLevel");
	jQuery('#menu > ul > li > a').addClass("parentLink");
	jQuery('#menu li:has(ul)').addClass("parentItem");
	var _sw = jQuery('.pageTitle h1').width();
	jQuery('.pageTitle h1').css("width",_sw+"px").hAlign();
	jQuery('blockquote').wrapInner('<div><div><div>');
	jQuery('hr').wrap('<div class="hr" />');
		var config = {   
		sensitivity: 3,
		interval: 0,  
		over: doOpen, 
		timeout: 100, 
		out: doClose  
		};
		function doOpen() {
		jQuery('ul:first',this).stop(true, true).slideDown('fast');
		$(this).addClass('hover');
		}
		function doClose() {
		jQuery('ul:first',this).stop(true, true).slideUp('fast');
		$(this).removeClass('hover');
		}
		jQuery('#menu li.parentItem').hoverIntent(config);
	var _menu;
	jQuery('#menu > ul > li').hover(function(){
		_menu = $(this).children('a:first-child');
		if($(this).hasClass('parentItem')){
			if($(this).hasClass('current_page_ancestor' || 'current_page_parent')){
				Cufon.replace(_menu, { fontFamily: 'ar', color: '#d29304'});
				}else{
			Cufon.replace(_menu, { fontFamily: 'ar', color: '#fbf9eb'});
				}
		}else{
			Cufon.replace(_menu, { fontFamily: 'ar', color: '#d29304'});
		}
		},function(){
			if($(this).hasClass('current_page_item')){
			Cufon.replace(_menu, { fontFamily: 'ar', color: '#d29304'});
			}else if($(this).hasClass('current_page_ancestor' || 'current_page_parent')){
			Cufon.replace(_menu, { fontFamily: 'ar', color: '#d29304'});	
			}else{
			Cufon.replace(_menu, { fontFamily: 'ar', color: '#fbf9eb'});
			}
		});
		$('a[rel="external"]').click(function(){
		  this.target = "_blank";
		});
		$('input[type="text"], textarea').each(function() {
		var default_value = this.value;
		$(this).focus(function() {
		if(this.value == default_value) {
		this.value = '';
		}
		});
		$(this).blur(function() {
		if(this.value == '') {
		this.value = default_value;
		}
		});
		});	
		//Combo Box
	   $('.option select').each(function(){
		var sName = $(this).attr("name");
		if(sName=='')
		 sName='cjSelect';
		var defVal = $(this).find("option:selected").text();
		$(this).wrap("<div class='combobox' id='combo"+sName+"' />");
		$(this).before("<span class='comboVal'>"+defVal+"</span>");
		$(this).change(function(){
		 var newVal = $(this).find("option:selected").text();
		 $(this).prev().text(newVal);
		});
	   });
});
(function ($) {
$.fn.vAlign = function() {
	return this.each(function(i){
	var h = $(this).height();
	var oh = $(this).outerHeight();
	var mt = (h + (oh - h)) / 2;
	$(this).css("margin-top", "-" + mt + "px");	
	$(this).css("top", "50%");
	$(this).css("position", "absolute");
	});	
};
})(jQuery);
(function ($) {

$.fn.hAlign = function() {
	return this.each(function(i){
	var w = $(this).width();
	var ow = $(this).outerWidth();	
	var ml = (w + (ow - w)) / 2;	
	$(this).css("margin-left", "-" + ml + "px");
	$(this).css("left", "50%");
	$(this).css("position", "absolute");
	});
};
})(jQuery);








