
var accessiblePopUp = {
	init : function() {		
		this.windowlocation.top = parseInt((this.screensize.height-this.windowsize.height)/2);
		this.windowlocation.left = parseInt((this.screensize.width-this.windowsize.width)/2);
		this.features = "width="+this.windowsize.width+",height="+this.windowsize.height+",left="+this.windowlocation.left+",top="+this.windowlocation.top+this.features;
	
		var popups = document.getElementsByTagName("a");
		for (i=0,len=popups.length;i<len;i++) {			
			if ( popups[i].getAttribute('rev') == "alternate") {
				popups[i].onclick = function() { return accessiblePopUp.popup(this.href); };
			}
		}	
	},		
	screensize : {"width" : screen.availWidth, "height": screen.availHeight},
	windowsize : {"width" : 750, "height": 500},
	windowlocation : {"top" : 0, "left": 0},
	features : ",titlebar=1,menubar=1,toolbar=0,location=0,scrollbars=1,status=1,resizable=1",	
	popup : function (url) {
		if (url.length) {
			var theWindow = window.open(url, "accessiblePopUp", this.features);
			try {
				if (theWindow.scrollBy) {
					theWindow.scrollBy(0,0);
				}
				if (theWindow.focus) {
					theWindow.focus();
				}
			} catch(err) {};
		}
		return false;
	}
	

};

/* Auto Run accessible Popup */
(function(){
	accessiblePopUp.init();
})();
