﻿/* various javascripts */


/* this will take the scrolled page to the top */
function takemeup() {
scrollTo(0,0);
}


/* popup larger images */
var popupwindow = 0;
function popUpImage(url, titlebar) {
var popupwindow = 0;
if (popupwindow.location && !popupwindow.closed) 
{ 
popupwindow.focus();
popupwindow.document.clear() 
} 
else 
{
popupwindow=window.open('','','width=480,height=560,resizable=1');
popupwindow.focus();
} 
popupwindow.document.writeln('<html> <head> <title>'+ titlebar +'<\/title> <\/head> <body onblur=\"self.close()\" bgcolor=\"silver\"><center>'); 
popupwindow.document.writeln('<img src=' + url + '>'); 
popupwindow.document.writeln('<a href=\"#\" onClick=\"javascript:self.close()\"><p style=\"font-family: Verdana, Arial, sans-serif; font-size: 10px; color: black;\">Close this window</p></a>');
popupwindow.document.writeln('<\/center>');
popupwindow.document.writeln('<\/body> <\/html>');  
popupwindow.document.close(); 
}

function closeMe() 
{
if (newwindow.location && !newwindow.closed) { newwindow.close(); } 
}

/* popup larger images */


function destroyPop() {
        if (popupwindow != '' && popupwindow.open) popupwindow.close();
}
window.onfocus=destroyPop; //destroys popupwindow on refocus the window


function openpopup(url){
var popurl=url
winpops=window.open(popurl,"","width=480,height=480,resizable,")
}


function Center(url,theWidth,theHeight){
var theTop=(screen.height/2)-(theHeight/2);
var theLeft=(screen.width/2)-(theWidth/2);
var aspects=
'height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+",scrollbars=n";
theWin=window.open(url,'',aspects);
}


function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;

//--------------------------------
// This code compares two fields in a form and submit it
// if they're the same, or not if they're different.
//--------------------------------

function checkEmail(theForm) {
    if (theForm.email.value != theForm.email_2.value)
    {
        alert('Sorry, your emails don\'t match!');
        return false;
    } else {
    return true;
    }
}

function joinNames()
	{
    document.forms.register_member_form.screen_name.value = document.forms.register_member_form.m_field_id_8.value + ' ' + document.forms.register_member_form.m_field_id_9.value;
  	}



function moveTOC()
{
document.getElementById("showtoc").innerHTML = document.getElementById("toc").innerHTML;
}


