// JavaScript Document

function GoTo(thisLink, content_section_id, content_type_id, content_id){
	mf = parent.document.getElementById('mainFrame')
	mf.src = 'content/index.php?content_section_id=' + content_section_id + "&content_type_id=" + content_type_id + "&content_id=" + content_id;
	if(thisLink == ''){
   	return;
  }
	ClearButtons();
	thisLink.className = "navLinkActive";
	curLink = thisLink;
	
}
function ClearButtons(){
	if(curLink == document.getElementById('hohBtn')){
    	curLink.className = "NavLinkHoH";
	} else {
		if(curLink != null) curLink.className = "NavLink";
	}
	curLink = null;
	btn = document.getElementById('quoteBtn');
	btn.style.borderBottom = "1px solid #4C251E"
}

function GoHoH(thisID){
	thisLink = document.getElementById('hohBtn');
	thisLink.className = "NavLinkHoHActive";
	if(thisLink != curLink){
		curLink.className = "navLink";
	}
	
	curLink = thisLink;
	mf = parent.document.getElementById('mainFrame')
	mf.src = "hoh/index.php?hoh_id=" + thisID;
}

function ShowContent(){
	if(theSectionID == 0 && theContentID == 0){
    	return;
  }
	alert ("hi");
	mf = document.getElementById('mainFrame');;
	if(theContentID == null || theContentID == ""){
		mf.src = 'content/index.php?content_section_id=' + theSectionID;
	} else {
		mf.src = 'content/index.php?content_section_id=' + theSectionID + "&content_id=" + theContentID;
	}
	thisLink = document.getElementById('section_' + theSectionID);
	if(thisLink) thisLink.className = "navLinkActive";
	curLink = thisLink;

	document.getElementById('homeBtn').className = 'navLink';
}
function GoCalendar(thisLink){
	ClearButtons();
	thisLink.className = "navLinkActive";
	curLink = thisLink;
	mf = document.getElementById('mainFrame');
	mf.src = 'calendar/calendar.php';
}
function GoQuotes(thisLink){
	ClearButtons();
	thisLink.className = "navLinkActive";
	curLink = thisLink;
	mf = document.getElementById('mainFrame');
	mf.src = 'quotes/index.php';
	var fbLinkData = 'http://www.facebook.com/plugins/like.php?href=http://www.educatorsofliberty.com/&amp;layout=box_count&amp;show_faces=true&amp;width=90&amp;action=like&amp;colorscheme=light&amp;height=65';
	var f = top.document.getElementById('fbLink');
	f.src = fbLinkData;
}

function GoHome(thisLink){
	ClearButtons();
	thisLink.className = "navLinkActive";
	curLink = thisLink;
	mf = document.getElementById('mainFrame');
	mf.src = 'home.php';
	var fbLinkData = 'http://www.facebook.com/plugins/like.php?href=http://www.educatorsofliberty.com/&amp;layout=box_count&amp;show_faces=true&amp;width=90&amp;action=like&amp;colorscheme=light&amp;height=65';
	var f = top.document.getElementById('fbLink');
	f.src = fbLinkData;

}


function ForgotPassword(){
	ClearButtons();
	mf = document.getElementById('mainFrame');
	mf.src = 'forgot.php';
}
function Contribute(){
	ClearButtons();

	mf = document.getElementById('mainFrame');
	mf.src = 'contribute/index.php';
}

function SuggestMovie(){
	ClearButtons();
	mf = document.getElementById('mainFrame');
	mf.src = 'SuggestMovie/index.php';
}

function Profile(){
	ClearButtons();
	mf = document.getElementById('mainFrame');
	mf.src = 'profile/index.php';
}

function ValidateForm(){
	with(document.login){
		if(user_name.value == ""){
      alert("You must supply a user name to login.");
			user_name.focus();
			return false;
		}
		if(user_password.value == ""){
     	alert("You must supply a password to login.");
			user_password.focus();
			return false;
    }
	}
	return true;
}
function mOver(btn){
	if(btn == curLink){
   	return;
  }
	if(btn.id == "hohBtn"){
		btn.className = "NavLinkHoHHover"
  } else {
		btn.className = "navLinkHover"
	}
	if(btn.id == "calendarBtn"){
		btn.style.borderBottom = "0px solid #4C251E;"
	}
}
function mOut(btn){
	if(btn == curLink){
    	return;
    }
	if(btn.id == "hohBtn"){
		btn.className = "NavLinkHoH"
    } else {
		btn.className = "navLink"
	}
	if(btn.id == "calendarBtn"){
		btn.style.borderBottom = "1px solid #4C251E"
	}
}
function DoVoid(){
	return;
}
function NextQuote(){
	clearTimeout(q);
	clearTimeout(d);
	// filter:alpha(opacity=60);-moz-opacity:.60;opacity:.60;
	if(document.all){
		var sf = document.getElementById('submitFrame');
		sf.src = "nextQuote.php?quote_text_id=" + curQuoteID;
	} else {
		DimDown();
	}

}
function DimUp(){
	
	txt = document.getElementById('quoteCell');
	img = document.getElementById('quoteImageCell');
	x = txt.style.opacity; sub = .1
	if(x != 1){
		x = parseFloat(x) + parseFloat(sub);
		txt.style.opacity = x;
		img.style.opacity = x;
		d = setTimeout("DimUp()", 50);
		return;
	}
	q = setTimeout("NextQuote()", 30000);
}
function DimDown(){
	txt = document.getElementById('quoteCell');
	img = document.getElementById('quoteImageCell');
	x = txt.style.opacity; sub = .1
	if(x != 0){
		x = x - sub
		txt.style.opacity = x;
		img.style.opacity = x;
		d = setTimeout("DimDown()", 50);
		return;
	}
	var sf = document.getElementById('submitFrame');
	sf.src = "nextQuote.php?quote_text_id=" + curQuoteID;
}
var q;
var d;

