// PORTLET INITIALIZATION
jQuery(document).ready(function(){       
	// BROWSER Detection //						   
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);

	// I have used IF statements to avoid missing elements or functions on pages. //
	// The effects will work only if the linked element exists in the document    //
	if ( jQuery(".column").length > 0 ) {

		// We create the protlets and style them accordingly by script //
		jQuery(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
			.find(".portlet-header")
				.addClass("ui-widget-header ui-corner-top")
				.prepend('<span class="ui-icon ui-icon-triangle-1-n"></span>')
				.end()
			.find(".portlet-content");
		// We make arrow button on any portlet header to act as a switch for sliding up and down the portlet content //
		jQuery(".portlet-header .ui-icon").click(function() {
			jQuery(this).parents(".portlet:first").find(".portlet-content").slideToggle("fast");
			jQuery(this).toggleClass("ui-icon-triangle-1-s"); 
			return false;	
		});
		// We disable the mouse selection on .column divs //
		//jQuery(".column").disableSelection();
	}
	// This function is making the info messages to slide up when the X is clicked //
	jQuery(".info").click(function() {
		jQuery(this).slideUp("fast");							 	  
	});
});
// THE jQuery scripts end here //
