$(document).ready(function(){
		
		if($(".f-date").length != 0){
		    $(".f-date").datepicker({ showOn: 'both', buttonImage: strThemeDir + '/img/icons/cal-launcher.gif', dateFormat: 'dd/mm/yy', buttonImageOnly: true });
		}

						   
		if($('.zebra-table').length) {
			$(".zebra-table tr:nth-child(even)").addClass("alt");
	 	}
		
		// in case of autocomplete which does not fire a js event
		setTimeout("checkForm()", 10);
		if($('.overlay-form').length != 0){
			$('.overlay-form input[type=text]').each(function()	{ setFocusValues($(this)); });
		}
		
		if($('.overlay-form').length) {
			$('.overlay-form input').each(function()	{ setFocusValues($(this)); });
			$('.overlay-form textarea').each(function()	{ setFocusValues($(this)); });
		}	
		
		if($(".scrollable").length){
			$(".scrollable").scrollable({ size: 1, vertical:false, speed:600, clickable:false }).autoscroll(8000).circular().navigator();
		}
		
		if($('.volunteer-login').length) {
			$('.volunteer-login').hide();
			$('.volunteer-login-button').click( function(){ 
				$('.volunteer-login').slideToggle("fast", function(){ 
					$('.volunteer-login-button').toggleClass("active"); }) 
			});
			$('.volunteer-login .close').click( function(){ 
				$('.volunteer-login').slideToggle("fast", function(){ 
					$('.volunteer-login-button').toggleClass("active"); }) 
			});			
		}
		
//		if($('ul.donation-select').length) {			
//			$("ul.donation-select").tabs(".donations > .donation");
//		}
		
		
		executeSifrReplacements_Global();
		

		
});

function setFocusValues(input) {
	input.focus(function(){ if ($(this).val() == '') {$(this).prev().addClass('focus');	}});	
	input.blur(function()	{ if ($(this).val() == '') { $(this).prev().removeClass('focus').removeClass('hastext');}});	
	if ($(input).val() != '') {$(input).prev().addClass('hastext');};	
	input.keydown(function(){ if ($(this).val() != '') {$(this).prev().addClass('hastext');}});	
}

function checkForm() {
	if($('.overlay-form').size() != 0){$('.overlay-form input[type=text]').each(function()	{ setFocusValues($(this)); });}
}