
var onDonates = false;
var onMovie = false;
var toggleMo = function(divmo){
	var otherdiv = divmo=='Donates' ? 'Movie' : 'Donates';
	var url = divmo=='Donates' ? 'specialprojects.html' : 'lormamovies.html';
    var ison = eval('on'+divmo);
    if(ison==false){
	    $.get(url,function(str){
		    $('#div'+divmo).html(str).show();
			//$('#divTabsMore').hide();
			$('div#lcdfi').click(function(){
				self.location.href='http://lcdfi.lorma.org/index.php?option=com_content&view=article&id=21&Itemid=21';
			});
			$('div#lhf').click(function(){
				self.location.href='http://lorma.org/index.php?option=com_content&view=article&id=655&Itemid=585';
			});
			$('div#elib').click(function(){
				self.location.href='http://amzn.com/w/1VSDLBUXUYZE8';
			});
			$('div#macagbareunion').click(function(){
				self.location.href='macagbareunion2011.html';
			});
			$('div#namnama').click(function(){
				self.location.href='http://www.namnama.org/contact-us';
			});
			$('div#hospinnovsite').click(function(){
				self.location.href='http://www.lorma.org/ccih/';
			});
		    },'text'
	    );
        eval('on'+divmo+' = true;');
    }else{
        $('#div'+divmo).show();
    }
	//$('#'+divmo).addClass('headeractive').removeClass('headerpassive');
	//$('#'+otherdiv).removeClass('headeractive').addClass('headerpassive');
	$('#div'+otherdiv).hide();
    //$('#divTabs div.divtab').addClass('divtabreset').removeClass('divtabdefault');
    //$('#divtabreset').show();
}

$(document).ready(function(){

/* 	$('.ui-accordion-content a').addClass('red'); */
	$('#divCollege').click(function() {
		self.location.href="http://lorma.edu/index.php";
		return true;
	});
	$('#divMedical').click(function() {
		self.location.href="http://lmc.lorma.org/";
		return true;
	});
	$('#divFoundation').click(function() {
		self.location.href="http://lorma.org/lcdfi/index.php";
		return true;
	});
	
	$('#divMovie div#divBook').css('cursor','default');
	$('.divSections').css('cursor','pointer');
	
	$('#divDonates').hide();
	$('#divMovie').hide();
	$('#divtabreset').hide();
	
	$('.showtabs').click(function(){
		var todiv = $(this).attr('id');
        if(todiv!='divtabreset'){
		    toggleMo(todiv);
        }else{
            //$('#divMovie').hide();
            //$('#divDonates').hide();
            //$('#divTabs div.divtab').removeClass('divtabreset').addClass('divtabdefault').addClass('headerpassive');
            //$('#divtabreset').hide();
			$('#divTabsMore').show();
        }
	});
	//$('#divTabs div.divtab').addClass('headeractive').addClass('divtabdefault');
	//$('.tabmore div span').hide();
	
	$('.tabmore div').css('background','none')
	.mouseout(function(){
		$('span',this).css('color','#6EAC2C');
	}).mouseover(function(){
		$('span',this).css('color','#0078ae');
	}).click(function(){
		toggleMo($(this).attr('open'));
		$('#divTabsMore').hide();
	});
	$('#enrollnow span').mouseover(function(){
		$('#imgenrollnow').show('slow');
	});
	$('#enrollnow span').click(function(){
		$('#imgenrollnow').hide('slow');
	});
	$('#imgenrollnow').mouseover(function(){
		$('#imgenrollnow').show();
	});
	$('#imgenrollnow').click(function(){
		self.location.href='http://lorma.edu/enrollnow/';
	});
	setTimeout("$('#imgenrollnow').hide('slow')",2000);
});


