/* create a timeOut function in jQuery */
jQuery.fn.idle = function(time){
	return this.each(function(){
		var i = $(this);
		i.queue(function(){
			setTimeout(function(){
			i.dequeue();
			}, time);
		});
	});
};

if (document.getElementById("contentLeft")){
	addEvent(window, 'load', initCorners);
}
function initCorners() {
	var settings = {
	  tl: { radius: 10 },
	  tr: { radius: 10 },
	  bl: { radius: 10 },
	  br: { radius: 10 },
	  antiAlias: true
	}
	
	/*
	Usage:
	
	curvyCorners(settingsObj, selectorStr);
	curvyCorners(settingsObj, Obj1[, Obj2[, Obj3[, . . . [, ObjN]]]]);
	
	selectorStr ::= complexSelector [, complexSelector]...
	complexSelector ::= singleSelector[ singleSelector]
	singleSelector ::= idType | classType
	idType ::= #id
	classType ::= [tagName].className
	tagName ::= div|p|form|blockquote|frameset // others may work
	className : .name
	selector examples:
	  #mydiv p.rounded
	  #mypara
	  .rounded
	*/
	curvyCorners(settings, ".leftNavBox");
}


	
$(document).ready(function(){
						   	
	// calendart toolti[s
	if (document.getElementById("rtCal")){			   
		$("a.calLink").tooltip({showURL: false});	
	}
	// event photos for admin
	if (document.getElementById("managePhotos")){
		$('#managePhotosLink').click(
			function() {$('#managePhotos').slideToggle('fast'); });
	}

	// event gallery/lightbox
	if (document.getElementById("gallery")){	
		$('#gallery a').lightBox({fixedNavigation:true});
	}
	// messagebox 
	if(document.getElementById("messageBox")){
		// fade out
		$('#messageBox').idle(5000).fadeOut('fast');
	}

	
});
