/* <![CDATA[ */

jQuery.noConflict();
 
jQuery(document).ready( function ($) { } );
								  
jQuery(function($) {


	$( 'dl.widget_text', $('body') ).hide();


	if( $('body').hasClass('page-template-noheadernosidebarnocomment-php')  )
	{
	 //$('body').pre_loader({delay:200, callback:removeloader});	
	
	} else if( $('body').hasClass('page-template-search-map-php')  ){
	
	//$('body').pre_loader({delay:200, callback:removeloader});	
	
	}else{
	    $('#header').pre_loader({delay:200, callback:removeloader});	
	$('#sidebar').pre_loader({delay:300, callback:removeloader});

	$('#content').pre_loader({delay:500, callback:removeloader});	
	}	

	
		$('#header-img ol').cycle();

	$('.popthis').live(
	'click',
	function(){
	
	$(this).fancybox({
					'width'				: '75%',
					'height'			: '95%',
					'centerOnScroll'	: true,
					'autoScale'     	: false,
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'type'				: 'iframe'
			});
	});
	
	
	$('.popthis').fancybox({
					'width'				: '75%',
					'height'			: '95%',
					'centerOnScroll'	: true,
					'autoScale'     	: false,
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'type'				: 'iframe'
			});
		// modal dialog init: custom buttons and a "close" callback reseting the form inside
		var $dialog = $( "#dialog" ).dialog({
			autoOpen: false,
			modal: true,
			open: function() {
			},
			close: function() {
			}
		});

 
	$dialog.dialog( "open" );
 
	$("a[href$='jpg'], a[href$='png'], a[href$='gif']").fancybox({ 
																	  'transitionIn'		: 'elastic',
																	  'transitionOut'		: 'elastic',
																	  'titlePosition'		: 'over'
																	  });			
		 
	$('a[rel*=external]').click( function() {
    window.open(this.href);
    return false;
	});


$(".ifjson a").removeAttr("title");

$('li:has(ul)',$(".ifjson")).each(function(){

	$('>a:first-child',this).append('<span class="ps">+</span>');
	//$( 'li:last', $(this).children('ul') ).addClass('last');
	$('.ps').addClass('ui-state-default ui-icon ui-icon-triangle-1-n');
	
	var parentlvl = $('.ps', $(this) ).parents("ul").length;
console.log(parentlvl);
	if( parentlvl >= 2 )
	{
			$('.ps', $(this) ).removeClass('ui-icon-triangle-1-n').addClass('ui-icon-triangle-1-w');

	} 
	
	$(this).hover(function(e){
	 parentlvl = $(this).parents("ul").length;

	
	$(this).find('ul:first').hoverFlow(e.type,{height:"show"},250,"easeInOutCubic",function(){
	
	$( $('>a:first-child', $(this).parent() ).find('.ps'), $(this).parent() ).html('-').removeClass('ui-icon-triangle-1-n').addClass('ui-icon-triangle-1-s');

		
		
	if( parentlvl >= 2 )
	{
			$( '.ps' , $(this).parent() ).removeClass('ui-icon-triangle-1-s ui-icon-triangle-1-w').addClass('ui-icon-triangle-1-e');

	}
		
		
		
		});

	

	},function(e){
	 parentlvl = $(this).parents("ul").length;

		$(this).find('ul:first').hoverFlow(e.type,{height:"hide"},450,"easeInBack",function(){
		$( $('>a:first-child', $(this).parent() ).find('.ps'), $(this).parent() ).html('-').removeClass('ui-icon-triangle-1-s').addClass('ui-icon-triangle-1-n');
	if( parentlvl >= 2 )
	{
			$(  '.ps' , $(this).parent() ).removeClass('ui-icon-triangle-1-n').addClass('ui-icon-triangle-1-w');

	}


		});
 
	});

});

		});
(function($) {
        $(function() {

			$(function() {
			$('.large').fadeOut();
			$(window).load(function() {
			$('.loader').hide();
			$('.large').fadeIn();
			}); });
          });
    })(jQuery);
	
	


(function($){
		  $.fn.hoverFlow=function(c,d,e,f,g){
			if($.inArray(c,['mouseover','mouseenter','mouseout','mouseleave'])==-1){
				  return this
				  }
			var h=typeof e==='object'?e:{complete:g||!g&&f||$.isFunction(e)&&e,duration:e,easing:g&&f||f&&!$.isFunction(f)&&f};
			h.queue=false;
			var i=h.complete;
			h.complete=function(){
			$(this).dequeue();
				if($.isFunction(i)){
					i.call(this)
					}};
			return this.each(function(){
				var b=$(this);
				if(c=='mouseover'||c=='mouseenter'){
					b.data('jQuery.hoverFlow',true)
					}else{
					b.removeData('jQuery.hoverFlow')
					}
					b.queue(function(){
					var a=(c=='mouseover'||c=='mouseenter')?b.data('jQuery.hoverFlow')!==undefined:b.data('jQuery.hoverFlow')===undefined;
					if(a){b.animate(d,h)}
					else{b.queue([])}})})
}})(jQuery);


 
/* ]]> */
