jQuery.fn.hint = function (blurClass) {
	if (!blurClass) {
		blurClass = 'blur';
	}

	return this.each(function () {
		var $input = jQuery(this),

		title = $input.attr('title'),
		$form = jQuery(this.form),
		$win = jQuery(window);

		function remove() {
			if ($input.val() === title && $input.hasClass(blurClass)) {
				$input.val('').removeClass(blurClass);
			}
		}

		if (title) {
			$input.blur(function () {
				if (this.value === '') {
					$input.val(title).addClass(blurClass);
				}
			}).focus(remove).blur();

			$form.submit(remove);
			$win.unload(remove);
		}
	});
};


$(document).ready(function(){
        $(".rpwtab").click(function() {
  			//alert('Handler for .click() called.');
			//alert();
			$(".rpwtab").find('a').removeClass('active');
			$(this).find('a').addClass('active');
			$(".rpwt").hide();	
			var id=$(this).find('a').attr("rel");
			$('#'+id).show();			
		});  
	callcalender();
});
function callcalender(mn,yr){
if (mn==undefined || mn==undefined ){
	var ur='/calender/';
}
else{
	var ur='/calender/'+mn+'/'+yr;
}
$.ajax({
  url: ur,
  success: function(data) {
    $('#calender').html(data);
  }
});
 return false;
}
$(document).ready(function() {
	$(".addHints").hint();

	$(document).ready(function(){
        $("ul.sf-menu").supersubs({
			delay      : 16000,
			animation  : {opacity: 'show', height: 'show'},
			speed      : 200,
            minWidth:    12,   // minimum width of sub-menus in em units
            maxWidth:    27,   // maximum width of sub-menus in em units
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over
                               // due to slight rounding differences and font-family
        }).superfish();  // call supersubs first, then superfish, so that subs are
                         // not display:none when measuring. Call before initialising
                         // containing tabs for same reason.
    });

	$(".main_image .desc").show(); //Show Banner
	$(".main_image .block").animate({opacity: 0.85}, 1 ); //Set Opacity
	
	$(".image_thumb ul li active").addClass('active'); //Add the active class (highlights the very first list item by default)
	$(".image_thumb ul li").click(function(){
		//Set Variables
		var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
		var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
		var imgDesc = $(this).find('.descblock').html();  //Get HTML of the "block" container
		var imgDescHeight = $(".main_image").find('.block').height(); //Find the height of the "block"

		if ($(this).is(".active")) {  //If the list item is active/selected, then...
			return false; // Don't click through - Prevents repetitive animations on active/selected list-item
		} else { //If not active then...
			//Animate the Description
			$(".main_image .block").animate({
				opacity: 0,
				marginBottom: -imgDescHeight
			}, 250 , function() { //Pull the block down (negative bottom margin of its own height)
				$(".main_image .block").html(imgDesc).animate({
					opacity: 0.85,
					marginBottom: "0"
				}, 250 ); //swap the html of the block, then pull the block container back up and set opacity
				$(".main_image img").attr({
					src: imgTitle ,
					alt: imgAlt
				}); //Switch the main image (URL + alt tag)
			});
		}
		//Show active list-item
		$(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all list-items
		$(this).addClass('active');  //Add class of 'active' on the selected list
		return false;

	}) .hover(function(){ //Hover effects on list-item
		$(this).addClass('hover'); //Add class "hover" on hover
	}, function() {
		$(this).removeClass('hover'); //Remove class "hover" on hover out
	});

	$("a.collapse").click(function(){
		$(".main_banner .block").slideToggle(); //Toggle the description (slide up and down)
		$("a.collapse").toggleClass("show"); //Toggle the class name of "show" (the hide/show tab)
	});
});

