// JavaScript Document
<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
	
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->


function bindNewWindow(){
	if (!document.getElementById("email_list_link")) {	return false;}
var listButton= document.getElementById("email_list_link");
listButton.onclick = function(){
	NewWindow(this.href,'mywin','600','500','no','center');
	return false;
	}
}

function bindBlurBackground(){
	if (!document.getElementById("email_list_link")) {	return false;}
var listButton= document.getElementById("email_list_link");
listButton.onfocus= function(){ this.blur()}
	}
	
 /** 
 * Checks that the required methods, getElementById and
 * getElementsByTagName, are available.
 * 
 * Returns true if the methods are available, false if they aren't.
 */ 
function detectMethods() {
	if (!document.getElementById) {
        return false;
    }
    if (!document.getElementsByTagName) {
        return false;
    }
	return true;
}

/** 
 * Performs method detection, then binds the form 
 * validation event handler and loads the email address
 * cookie, if there is one.
 */ 
function bindCommonEventHandlers() {
    if (!detectMethods()) {
		return false;
	}
	bindNewWindow();
	bindBlurBackground();

}

/**
 * Binds function bindEventHandlers to window's onload event:
 * when browser finishes loading the page, it will 
 * call bindEventHandlers
 */    

window.onload = bindCommonEventHandlers;
