var links = document.getElementsByTagName("a"); var page = { init : function() { this.preparePopUps(); this.prepareDirectory(); // this.prepareTracking(); this.prepareFeeds(); // this.prepareToFavourites(); /*this.logStats();*/ YAHOO.util.Event.addListener(window, 'resize', this.reSize); // this.open_notificationBox(); }, popwin : function(e) { YAHOO.util.Event.stopEvent(e); window.open(this.getAttribute("href"), "_blank", "scrollbars=yes") }, popwin_alt : function(e) { YAHOO.util.Event.stopEvent(e); window.open(this.getAttribute("href"), "_blank") }, preparePopUps : function() { for (var i=0; i= 0) { if (classname.indexOf('popup-alt') >= 0) { YAHOO.util.Event.addListener(links[i], 'click', this.popwin_alt); } else { YAHOO.util.Event.addListener(links[i], 'click', this.popwin); } } } }, prepareDirectory : function() { var listings = document.getElementById('listings'); if (listings) { var boxes = listings.getElementsByTagName('div'); for (var i=0; i= 0) { var box_link = boxes[i].getElementsByTagName('a'); var box_href = box_link[0].getAttribute('href'); boxes[i].setAttribute('href', box_href); YAHOO.util.Event.addListener(boxes[i], 'click', this.popwin_alt); } } } }, prepareFeeds : function() { var lists = document.getElementsByTagName('ul'); for (var i=0; i= 0) { var t_id = classname.match(/tracked\-\d+/); if (t_id) { var tracked = t_id.toString(); var goto_id = tracked.substring(8, tracked.length); links[i].href = '/goto/'+goto_id; } } } }, prepareToFavourites : function () { var AddFavorite = function () { var url = "http://www.us.com"; var title = "D-E-I" if ( window.external ) { // IE Favorite this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.us.com'); } else { window.location = "http://www.us.com/makehomepage"; } } var Favorite = document.getElementById('AddFavorite'); YAHOO.util.Event.addListener(Favorite, 'click', AddFavorite) }, logStats : function() { var vh, vw, sh, sw = 0; sw = screen.width; sh = screen.height; vw = YAHOO.util.Dom.getViewportWidth(); vh = YAHOO.util.Dom.getViewportHeight(); YAHOO.util.Connect.asyncRequest("GET","/util/browserstats.php?vw="+vw+"&vh="+vh+"&sh="+sh+"&sw="+sw, false); }, open_notificationBox : function() { if(this.readCookie("close_adBox") != "1") { document.getElementById('notification').style.display = 'block'; var open = new YAHOO.util.Motion("notification", { points: { by: [0, 195] } }, 1,YAHOO.util.Easing.easeOut); open.animate() YAHOO.util.Event.addListener("confirm_notification","click",this.close_notificationBox); YAHOO.util.Event.addListener("close_notification","click",this.close_notificationBox); YAHOO.util.Event.addListener("close_notification_link","click",this.close_notificationBox); } }, close_notificationBox : function() { var close = new YAHOO.util.Motion("notification", { points: { by: [0, -195] } }, 1,YAHOO.util.Easing.easeIn); var removeElement = function() { var el = this.getEl(); el.parentNode.removeChild(el); } close.onComplete.subscribe(removeElement); close.animate(); document.cookie = "close_adBox = 1"; }, readCookie : function(name) { var ca = document.cookie.split(';'); var nameEQ = name + "="; for(var i=0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } }; function initPage() { page.init();}