//Cufon.replace('.advanced .view-item-list a h2,.content-view-line a h2',{
//		'hover':true,
//		'hoverables':{'a':true,'h2':true}
//	});
Cufon.replace('a.button,.date-icon .month,.date-icon .date,.custom-tag-featuredpages h1',{'textTransform':'uppercase'});
Cufon.replace('.customtag header h1,.custom-tag-geomap h2',{'fontSize':'22px','fontWeight':'normal','textTransform':'uppercase'});
Cufon.replace('.resources_by_category .content-view-children .content-view-line h2',{'fontSize':'20px','fontWeight':'normal','textTransform':'uppercase'});
Cufon.replace('#extrainfo .custom-tag-gtcmwidget h1',{'fontSize':'16px','fontWeight':'normal','textTransform':'uppercase'});


$(function(){
	
	if ($(".pagenavigator .pages span").length) {
		$(".pagenavigator .pages span").each(function(){
			if ($(this).find("a")) {
				$(this).css('cursor','pointer').click(function(){
					document.location.href = $(this).find("a").attr('href');
				})
			}
		})
	}
	
	$('.content-view-line.line-image .attribute-image img,.content-view-embed.line-image .attribute-image img').each(function(){
		$(this).parent('.attribute-image').css({'left':((120-this.width)/2)+'px'});
	});
/*
	$('.custom-tag-geomap img#geomap').hover(function(){
		
	},function(){
		
	});
*/
	$('#alerts .close').click(function(){
		$(this).parents('#alerts').slideUp();
	});
//	if ($('.scrollable').length) {
//	$('.scrollable').scrollable({
//			'next':'.nextPage',
//			'prev':'.nextPage',
//			'circular':true
//		}).autoscroll();
//	};
	


	// nav dropdowns
	$("#global-menubar ul.menu > li").each(function() {
		if ($(this).find("ul").length > 0){
			var obj=$(this),
			ul=obj.find("ul");
			// $("<span>").text("+").appendTo(obj.children(":first"));
			obj.hover(function(){
				if($.browser.msie){
					ul.stop(true,true).show();
				}else{
					ul.stop(true,true).slideDown();
				}
			},function(){
				if($.browser.msie){
					ul.stop(true,true).hide();
				}else{
					ul.stop(true,true).slideUp();
				}
			});
		}
	});

	$('.slideshow').imorphiclite({
		'fx':'fade',
		'timeout':10000,
		'autostart':1,
		'controls':'jump'
	});

});


var initScrollingItems=function(objectNode, parameters){
	if (typeof parameters != 'object') parameters = {loop:true};
	if (typeof parameters.loop == 'undefined') parameters.loop = true;
	var scrollable = jQuery(objectNode).scrollable({
		'circular':true,
		'loop':parameters.loop,
		'next':'.nextPage',	
		'prev':'.prevPage',		
		'clickable':false
    });
  	if(parameters.autoscroll){scrollable.autoscroll({'steps':parameters.size});}
  	if(parameters.mousewheel){scrollable.mousewheel();}
}

