//Code for add event
function addEvent(a,b,c,d){if(a.addEventListener){a.addEventListener(b,c,d);return true}else if(a.attachEvent)return a=a.attachEvent("on"+b,c);else a["on"+b]=c};

//Code for popup
function addEvent(a,b,c,d){if(a.addEventListener){a.addEventListener(b,c,d);return true}else if(a.attachEvent)return a=a.attachEvent("on"+b,c);else a["on"+b]=c};addEvent(window,"load",findPopUps,false);var newWindow=null;function closeWin(){if(newWindow!=null)newWindow.closed||newWindow.close()} function popUpWin(a,b,c,d){closeWin();b=b.toLowerCase();if(b=="fullscreen"){c=screen.availWidth;d=screen.availHeight}var e="";if(b=="standard")e="resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+c+",height="+d+",top=0,left=0";if(b=="console"||b=="fullscreen")e="resizable,toolbar=no,location=no,scrollbars=no,width="+c+",height="+d+",left=0,top=0";newWindow=window.open(a,"newWin",e);newWindow.focus()} function doPopUp(a){var b="standard",c="780",d="580";attribs=this.rel.split(" ");if(attribs[1]!=null)b=attribs[1];if(attribs[2]!=null)c=attribs[2];if(attribs[3]!=null)d=attribs[3];popUpWin(this.href,b,c,d);if(window.event){window.event.returnValue=false;window.event.cancelBubble=true}else if(a){a.stopPropagation();a.preventDefault()}} function findPopUps(){var a=document.getElementsByTagName("a");for(i=0;i<a.length;i++)if(a[i].rel.indexOf("popup")!=-1){a[i].onclick=doPopUp;if(a[i].rel.indexOf("noicon")==-1){a[i].style.backgroundImage="url(pop-up.gif)";a[i].style.backgroundPosition="0 center";a[i].style.backgroundRepeat="no-repeat";a[i].style.paddingLeft="15px"}a[i].title+=" [Opens in a new window]"}}addEvent(window,"load",findPopUps,false);

