// JavaScript Document
var MESS_CONFIRM = 'confirm';
var MESSAGES = new Array();
MESSAGES[MESS_CONFIRM] = 'Are you sure you want to delete this item?';

$(document).ready(function(){	

	$('.sideBarCalendar').datepicker({
		showOn: 'button',
		buttonImage: httpPath + '/images/calendar.gif',
		buttonImageOnly: true,
		showOn: 'both'
	});	
	
	$(".gradientButton").hover(
		function() {$(this).addClass("gradientButton-hover1")},
		function() {$(this).removeClass("gradientButton-hover1")}
	);	
	$(".gradientButtonHover2").hover(
		function() {$(this).addClass("gradientButton-hover2")},
		function() {$(this).removeClass("gradientButton-hover2")}
	);	
	
	$(".gradientButton1").hover(
		function() {$(this).addClass("gradientButton1-hover1");},
		function() {$(this).removeClass("gradientButton1-hover1");}
	);		
	
	$('p.faq').click(function(event){
	$(this).next('.answerBox').slideToggle();
    });
	
	$('.confirm').live('click', function(){
		return confirm(MESSAGES[MESS_CONFIRM]);
	});
	
	$('#more').bind('click', function(){

		if($('.subNavContainer:visible').length < 0)
		{
			$('.subNavContainer').hide('blind', 'fast');
			$('#clickBackground').hide();
		}
		else
		{
			$('#clickBackground').width($(window).width()).height($(window).height()).css('z-index', 800);
			$('#clickBackground').show();
			var offset = $(this).offset();
			$('.subNavContainer').css('left', offset.left - 100 + 'px')
								 .css('top', offset.top + 30 + 'px')
								 .css('z-index', 1000)
								 .show('blind', 'fast');
		}
		return false;
	});
	
	
	$('#clickBackground').bind('click', function(){
		$('.subNavContainer:visible').hide('blind', 'fast');
		$('.popup:visible').hide('blind', 'fast');
		$(this).hide();
	});
});


function htmlspecialchars(html) { 
	html = html.replace(/&/g, "&amp;"); 
	html = html.replace(/</g, "&lt;"); 
	html = html.replace(/>/g, "&gt;"); 
	html = html.replace(/"/g, "&quot;"); 
	return html; 
}
