
//show and hide divs
function showHide(divId) { 
var div = document.getElementById(divId);
var a = document.getElementById('a' + divId);
var i = document.getElementById('i' + divId);
	if (div.style.display == 'none') {
		div.style.display = 'block';
		i.src = 'images/-.gif';
	}
	else {
		div.style.display = 'none';
		i.src = 'images/+.gif';
	}
}


//image popup adapted from www.pcurtis.com/popup_advanced.htm
function popitup5(url, title, iwidth, iheight, colour) {

    var newwindow = '';
    var pwidth, pheight;
    var screenH = screen.Height;
    var t //top offset
    var l //left offset

    //set height and offset of new window based on screen height and image size
    if (iheight >= (screenH - 150)){
        pheight = screenH - 150;
    }
    else {
        pheight = iheight + 20;
        if (title != '') {
            pheight = iheight + 89;
        } 
    }    

    if (screenH <= 768) {
        t = 25;
        l = 25;
    }
    else {
        t = 100;
        l = 100;
    }

    pwidth=iwidth+36;
    newwindow=window.open('','','width=' + pwidth + ',height=' + pheight + ',toolbar=0,status=1,scrollbars=1,resizable=1,menubar=0,location=0,directories=0,dependant=1,top=' +t + ',left=' +l);
    
    newwindow.document.clear();
    newwindow.focus();
    newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body style="margin:10px 0 6px 0; text-align:center;" bgcolor=\"' + colour + '\">');
    newwindow.document.writeln();
    newwindow.document.writeln('<img src=\"' + url + '\" width=\"' + iwidth + '\" height=\"' + iheight + '\" alt=\"' + title + '\" >');
    if (title != '') {
        newwindow.document.writeln("<table align='center' style='margin-top:5px;' width=" + iwidth + " cellpadding=0 cellspacing=0><tr><td style='height:60px;text-align:center;vertical-align:middle;background-color:white;padding:5px;color:#333;font-family:arial;font-size:9pt;font-weight:bold;'>" + title + '<\/td><\/tr><\/table>')
        }
    newwindow.document.writeln('<\/body> <\/html>');
    newwindow.document.close();
    newwindow.focus();
}


//popup articles
function articlePop(sFile,w) {
    window.name = "main";
    h = screen.Height;
    if (h <= 768) {
        h = screen.Height - 100;
        t = 20;
        l = 30;
    }
    else {
        h = 750;
        t = 50;
        l = 100;
    }
    sopts = "toolbar=0,status=1,scrollbars=1,resizable=1,menubar=0,location=0,directories=0,dependant=1" + ",width=" + w + ",top=" + t + ",left=" + l + ",height=" + h;
    artWin = window.open(sFile,"artWin",sopts);
    artWin.resizeTo(w,h);
    artWin.focus();
} 
