
////////////////////////////////////////////////////////////

function PrintPage() {
    window.print()
}

////////////////////////////////////////////////////////////

function MailGann(prefix) {
    location = 'mailto:<' +prefix +'@gannacademy.org>'
}

function Mailaddr(prefix,domain) {
    location = 'mailto:<' +prefix +'@' +domain +'>'
}

////////////////////////////////////////////////////////////

function CleanSymbols(txt) {

    // Replace & before using it to represent other symbols
    txt = txt.replace(/ & /g, " &amp; ");

    // Replace various forms of double quotes
    txt = txt.replace(/["¨“”]/g, '&quot;');

    // Replace various forms of single quotes
    txt = txt.replace(/['‘’`´]/g, "&#039;");

    // Replace various dash-like characters
    txt = txt.replace(/–/g, "&#8211;");		// en dash
    txt = txt.replace(/—/g, "&#8212;");		// em dash

    // Replace other characters
    txt = txt.replace(/•/g, "-");		// bullet

    return (txt);
}

////////////////////////////////////////////////////////////

function PreviewHTML(html) {
    html = CleanSymbols(html)
    var url;
    url = '/utilities/PreviewHTML.asp?HTML=' +escape(html)
    PopupWindow(url)
}


function PreviewAlumniNews(html) {
    var url;
    url = '/utilities/PreviewAlumniNews.asp?HTML=' +html
    PopupWindow(url)
}


function PopupGallery(galleryID,category) {
    var url;
    url = '/utilities/DisplayGallery.asp?GalleryID=' +galleryID +'&Category=' +category
    PopupWindow2(800,540,url)
}


function PopupDirections(venueID) {
    var url;
    url = '/utilities/DisplayDirections.asp?VenueID=' +venueID
    PopupWindow(url)
}


function PopupAlumni(alumniID) {
    var url;
    url = '/utilities/DisplayAlumniInfo.asp?AlumniID=' +alumniID
    PopupWindow(url)
}


function PopupCourse(courseID) {
    var url;
    url = '/utilities/DisplayCourseDescription.asp?CourseID=' +courseID
    PopupWindow(url)
}


function PopupWindow(url) {
    PopupWindow2(550,380,url)
}


function PopupWindow2(w,h,url) {

    var args;
    args = 'width='+w +',height='+h +',left=0,top=0,screenX=0,screenY=0';
    args = args + ',resizable=1,location=0,menubar=0,toolbar=0,scrollbars=1';
    args = args + ',status=0,channelmode=0,dependent=0,directories=0,fullscreen=0';

    var win = window.open(url,'popup',args);
    win.resizeTo(w,h);
    win.focus();
}


////////////////////////////////////////////////////////////


window.onerror = null;
var plusImg  = new Image();
var minusImg = new Image();
plusImg.src  = "../images/common/plus.gif";
minusImg.src = "../images/common/minus.gif";
var maxID = 0


function faqHide(id)
{
	var thisLevel = document.getElementById( 'faq'+id );
	var thisImg   = document.getElementById( 'faq'+id+'Img' );
	thisLevel.style.display = "none";
	thisImg.src = plusImg.src;
}

function faqShow(id)
{
	var thisLevel = document.getElementById( 'faq'+id );
	var thisImg   = document.getElementById( 'faq'+id+'Img' );
 	thisLevel.style.display = "block";
	thisImg.src = minusImg.src;
}

function faqToggle(id)
{
	var thisLevel = document.getElementById( 'faq'+id );
	if ( thisLevel.style.display == "none") {
	    faqShow(id)
	}
	else {
	    faqHide(id)
	}
}

function faqHideAll() {
	for (var id=1; id<=maxID; id++) { faqHide(id); }
}
 
function faqShowAll() {
	for (var id=1; id<=maxID; id++) { faqShow(id); }
}

function faqSetMaxID(x) {
	maxID = x
}

////////////////////////////////////////////////////////////

