
var $j = jQuery.noConflict();
// Use jQuery via $j(...)
$j(document).ready(function(){
	$j("a[rel=example_group]").fancybox({'transitionIn': 'none','transitionOut': 'none','titlePosition' : 'over','titleShow': false,'padding': 0});
});


function popIt(url,width, height,scrollbars){
            if(!width) width = "295";
            if(!height) height = "500";
            if(!scrollbars) scrollbars = 0;

            var windowString = 'width=' + width + ',height=' + height + ',resizable=0,status=0,toolbar=no,scrollbars=' + scrollbars + ',scrolling=auto';
            var popItWindow = window.open(url, 'popIt', windowString);
}

window.addEvent('domready', function(){

	window.addEvent('load', function(){
		if ($('Main').getHeight() < window.getHeight()){
			$('MainContent').setStyles({'height': window.getHeight()-$('Footer').getHeight()-67});
		}
	});
	
	if ($('myForm')){
		$('myForm').addEvent('submit', function(event) {
			event.preventDefault();
			SubmitFooterForm();
		});
	}
	
	
});

function SubmitFooterForm(){
	//Empty the log and show the spinning indicator.
	var log = $('log_res').empty().addClass('ajax-loading');
	//Set the options of the form's Request handler. 
	//("this" refers to the $('myForm') element).
	$('myForm').set('send', {onComplete: function(response) { 
		log.removeClass('ajax-loading');
		log.set('html', response);
	}});
	//Send the form.
	$('myForm').send();
}

function showDiv(id){
	if ($(id).getStyle('display') == 'none'){
		$('ReadMoreBt'+id).set({'html': closetext});
		$(id).setStyles({'display':'block'});
	} else {
		$('ReadMoreBt'+id).set({'html': readmoretext});
		$(id).setStyles({'display':'none'});
	}
}
