// JavaScript Document
jQuery(document).ready(function() {
$.ajaxSetup ({cache: true});
var ajax_load = "<img src='/wp-content/themes/sterland_oliver/js/images/loading.gif' alt='loading...' />";
$(".hide_if_javascript_enabled").css({ display: "none"});

// print button
$(".print").click(function(){
						   window.print();
						   return false;
						   })	
	
$('.menu li ul').addClass('js_enabled').css({display:'none'});
$('.page_item ul, .cat-item ul').css({position:'absolute'});
$('.menu li, .menu li ul').hover(
	function(){
		$('ul', this).css({display:'block'});
	},
	function(){
		$('ul', this).css({display:'none'});
		//setTimeout('hideTip()', 1000);
	}
);

$('.arrow_down li ul').append('<li class="arrow_down" >&nbsp;</li>');
$('.arrow_up li ul').prepend('<li class="arrow_up" >&nbsp;</li>');


jQuery("#search_wrapper").css({ height: 0 }, 500);
jQuery("#search_btn").toggle(
    function() {
        jQuery("#search_wrapper").animate({ height: 40 }, 500);
    },
    function() {
        jQuery("#search_wrapper").animate({ height: 0 }, 500);
    }
);


jQuery('#scroll_top').click(function(){
	jQuery('html, body').animate({scrollTop:0}, 'slow');
	return false
});

$('#process_methods .title:first').addClass('help').attr({title:'click the titles to see our step by step processes'})
jQuery(".description").hide();
jQuery(".description:first").show();
jQuery(".title, .description").click(
    function() {
        jQuery(".description").hide('fast');
		jQuery(".title").removeClass('active');
		jQuery(this).addClass('active').next(".description").show('fast');
    });


var js_title  = $(".js_title").html();
$('input[title*="apply"]').attr({value:js_title})

$('<link/>', {'href':'/wp-content/themes/sterland_oliver/js/colorbox.css','type':'text/css', 'rel':'stylesheet', 'media':'screen'}).appendTo('head');
$.getScript('/wp-content/themes/sterland_oliver/js/jquery.colorbox-min.js', function(){
											   
					$(".apply").colorbox({width:"80%", inline:true, href:".apply_form"});
					$('.iframe_colorbox').colorbox({iframe:true, width:'80%', height:'80%'});
															   
});//getScript
	
$('.help').mouseenter(function(){
					  var title = $(this).attr('title');
					  $(this).prepend('<span class="tooltip">' + title + '<img src="/wp-content/themes/sterland_oliver/images/trans/trans_triangle_85k_down.png" width="15" height="7" /></span>').css({position:'relative'})
					  $(this).mouseleave( function(){
												   $('span').remove('.tooltip')
												   })
					  })
	
	
	
});
// function hideTip() { $('ul.js_enabled').css({display:'none'});}
