<!--

jQuery(document).ready(
function() {
	// Frame containers expand/colapse
	//jQuery.cookie('fcExpandedContents', '');
	fccookie = jQuery.cookie('fcExpandedContents');
	
	if (fccookie == null)
		fccookie = '';
		
	function toggleFC(fc, preload) {
		fclink = jQuery(fc);
		fccontent = jQuery(fc).next();
		fcparent = jQuery(fc).parent();
		
		if (fclink.is(".expanded") || fcparent.is(".expanded")) {
			fccontent.hide((!preload?'slow':null));
			
			fclink.removeClass("expanded");
			fclink.addClass("colapsed");
		
		} else {
			fccontent.show((!preload?'fast':null));
			
			fclink.removeClass("colapsed");
			fclink.addClass("expanded");
		}
		
		fcparent.removeClass("expanded");
			
		if (!preload && fclink.attr('name')) {
			if (fccookie.indexOf('|'+fclink.attr('name').replace(/^fc/, '')) == -1)
				fccookie = fccookie+'|'+fclink.attr('name').replace(/^fc/, '');
			else
				fccookie = fccookie.replace(new RegExp('\\|'+fclink.attr('name').replace(/^fc/, ''), 'g'), "");
			
			jQuery.cookie('fcExpandedContents', fccookie, { expires: 10 });
		}
	}
	
	fcs = fccookie.split('|');
	for(var i in fcs) {
		if (fcs[i]) {
			fcdivs = document.getElementsByName('fc'+fcs[i]);
			if (fcdivs && fcdivs[0])
				toggleFC(fcdivs[0], true);
		}
	}
	
	jQuery(".fc-title").click(function(){
		toggleFC(this);
	});
	
	// Quick Login form
	jQuery(".quick-login").click(function(e){
		loginform = jQuery("#quickloginform");
		
		if (loginform.css('display') == 'block') {
			loginform.hide('slow');
			
		} else {
			loginform.css('top', parseInt(e.pageY+10)+'px');
			loginform.css('left', e.pageX+'px');
			loginform.show('fast');
		}
	});
	
	// Calendar Inputs
	jQuery(".calendar-input").each(function(){
		if (jQuery(this).is('.timestamp')) {
			d = new Date();
			dateformat = 'yy-mm-dd '+d.getHours()+':'+d.getMinutes();
		} else {
			dateformat = 'yy-mm-dd';
		}
		
		jQuery(this).datepicker({dateFormat: dateformat});
	});
	
	jQuery(".show-calendar-input").click(function(){
		jQuery(this).parent().find('input').focus();
		return false;
	});
	
	jQuery(".clear-calendar-input").click(function(){
		jQuery(this).parent().find('input').val('');
		return false;
	});
	
	// Check all checkboxes
	jQuery(".checkbox-all").click(function(){
		var checked_status = this.checked;
		
		jQuery(this).parents("form").find("input[type=checkbox]").each(function(){
			this.checked = checked_status;
		});
	});
	
	// LightBox
	var lightboxes = new Array();
	jQuery('a[rel^=lightbox]').each(function() {
		rel = jQuery(this).attr('rel');
		
		if (jQuery.inArray(rel, lightboxes) == -1) {
			lightboxes[lightboxes.length] = rel;
			jQuery(this.tagName + '[href][rel="' + jQuery(this).attr('rel') + '"]').lightBox();
		}
	});
	
	// Confirm a link submittion
	jQuery('.confirm-link').click(function() {
		return confirm('Please confirm your action: '+jQuery(this).attr('title')+'?!');
	});
	
	// Fix transparent pngs for IE5 and IE6
	jQuery(document).pngFix();
	 
	// qTooltips
	jQuery('.qtip').qtip({ style: { name: 'cream', tip: true }, position: {adjust: {screen: true}}});
	
	// Star ratings
	jQuery('.star-rating').rating({split: 2});
	
	// Ajax links
	jQuery('.ajax-link').ajaxLink();

	// Ajax content links
	jQuery('.ajax-content-link').ajaxContentLink();

	// Ajax paginating
	jQuery('.paging-ajax a').ajaxPaging();
});

-->