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") {
	var url = anchor.getAttribute("href");
	new_anchor="javascript:pop_new('" + url + "'); void 0;";
	anchor.setAttribute("href",new_anchor);
}
 }
}

function pop_new(url) {
	newwindow=window.open(url,'pop_win','height=' + win_height + ',width=' + win_width + ',top=' + win_top + ',left=' + win_left + ',scrollbars,toolbar,menubar,resizable,location');
	if (window.focus) {newwindow.focus()}
	return false;
}

$(document).ready(function() {
	win_width = $(window).width() -40;
	win_height = $(window).height() -40;
	var oldScreenX =   document.all ? window.screenLeft : window.screenX;
	var oldScreenY =  document.all ? window.screenTop -63 : window.screenY;
	win_top = oldScreenY +10;
	//alert(win_top);
	win_left = oldScreenX +20;
	//alert(win_left);
	//var winProperties = exampleClosureForm(win_width, win_height);
	//alert(winProperties[0]);
	//alert(win_width);
	externalLinks();
});


function exampleClosureForm(arg1, arg2){
    var localVar = 8;
    function exampleReturned(innerArg){
        return ((arg1 + arg2)/(innerArg + localVar));
    }
    /* return a reference to the inner function defined as -
       exampleReturned -:-
    */
    return exampleReturned;
}