// EffectElement represents a DOM element to fade //-------------------------------------------------------------------------------------------------------------------------------- function EffectElement(_element, _startAlpha, _endAlpha, _timeInSeconds){ this.element = _element; this.startAlpha = _startAlpha; this.endAlpha = _endAlpha; this.timeInSeconds = _timeInSeconds; this.started = false; this.startTime = 0; this.alphaRange = _startAlpha - _endAlpha; } //Controller class to manage the alpha effects //-------------------------------------------------------------------------------------------------------------------------------- function AlphaEffect(){ this.BeginFade = BeginFadeMethod; } AlphaEffect.ProcessFade = ProcessFadeMethod; AlphaEffect.objectsToFade = new Array(); AlphaEffect.isProcessing = false; AlphaEffect.processingInterval = null; //Runs on an interval when there are elements to be processed, this method caluclates the current alpha value for //each element in the AlphaEffects controller //-------------------------------------------------------------------------------------------------------------------------------- function ProcessFadeMethod(vard){ //Track elements whose alpha transitions have finished for later removal elementsToRemove = new Array(); //Cycle through each element undergoing an alpha transition for(i=0;i currentEffectElement.timeInSeconds){ timePassed = currentEffectElement.timeInSeconds; elementsToRemove.push(i); } //Calculate the current alpha value alphaValue = Math.abs(currentEffectElement.alphaRange)*timePassed/currentEffectElement.timeInSeconds; if(currentEffectElement.alphaRange<0) alphaValue += currentEffectElement.startAlpha; else alphaValue = currentEffectElement.startAlpha - alphaValue; //Set the elements alpha value in a cross-browser way currentEffectElement.element.style.opacity = alphaValue; currentEffectElement.element.style.filter = 'alpha(opacity=' + alphaValue*100 + ')'; //Again check if this is the first processing cycle if(currentEffectElement.started == false){ currentEffectElement.started = true; //If this element is not being displayed, display it if(currentEffectElement.element.style.display=="none"){ currentEffectElement.element.style.display="block"; } } } //elementsToRemove tracks the indices of elements to be removed. As elements are removed, the indices will become incorrect due //to the decreasing array size. deleteOffset tracks the number of deletions to correct the indices deleteOffest = 0; //Cycle through all elements that are finished processing for(i=0;i0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var C={},A=arguments,B;for(B=0;B=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.1",build:"541"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){B=H[0];}try{G=L.fn.call(K,B,L.obj);}catch(F){this.lastError=F;}}else{try{G=L.fn.call(K,this.type,H,L.obj);}catch(F){this.lastError=F;}}if(false===G){if(!this.silent){}return false;}}}if(I){var J=[],C=this.subscribers;for(D=0,E=C.length;D=0){Q=I[R];}if(!M||!Q){return false;}if(this.useLegacyEvent(M,L)){var O=this.getLegacyIndex(M,L);var N=E[O];if(N){for(P=0,S=N.length;P0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var M,L,O,N;for(M=0,L=F.length;M0){for(var R=0,S=T.length;R0){O=I.length;while(O){N=O-1;M=I[N];if(M){R.removeListener(M[R.EL],M[R.TYPE],M[R.FN],N);}O=O-1;}M=null;R.clearCache();}for(P=0,L=G.length;P");B=document.getElementById("_yui_eu_dr");}if(B){B.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}B=null;}else{if(D.webkit){D._drwatch=setInterval(function(){var F=document.readyState;if("loaded"==F||"complete"==F){clearInterval(D._drwatch);D._drwatch=null;D._ready();}},D.POLL_INTERVAL);}else{D._simpleAdd(document,"DOMContentLoaded",D._ready);}}D._simpleAdd(window,"load",D._load);D._simpleAdd(window,"unload",D._unload);D._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{}; var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C * Copyright (c) 2007, Yahoo! Inc. All rights reserved. * Code licensed under the BSD License: * http://developer.yahoo.net/yui/license.txt * * @requires yahoo, event * @namespace YAHOO.util * @title IFrame Message Routing Utility */ /** * The CrossFrame singleton allows iframes to safely communicate even * if they are on different domains. This utility requires a proxy HTML * file (proxy.html) * * @class CrossFrame */ YAHOO.util.CrossFrame = (function () { var r1 = /^(((top|parent|frames\[((['"][a-zA-Z\d-_]*['"])|\d+)\]))(\.|$))+/; var r2 = /top|parent|frames\[(?:(?:['"][a-zA-Z]*['"])|\d+)\]/; function parseQueryString(s) { var r, a, p; r = {}; a = s.split('&'); for (i = 0; i < a.length; i++) { p = a[i].split('='); if (p.length === 2 && p[0].length > 0) { r[p[0]] = unescape(p[1]); } } return r; } if (YAHOO.env.ua.opera) { // Opera does not allow reading any property (including parent, frames) // if the domain of the caller and the domain of the target window do // not match. We work around this by chaining calls, and using Opera's // postMessage function... document.addEventListener("message", function (evt) { var o = parseQueryString(evt.data); if (YAHOO.lang.hasOwnProperty(o, "target") && YAHOO.lang.hasOwnProperty(o, "message") && YAHOO.lang.hasOwnProperty(o, "domain") && YAHOO.lang.hasOwnProperty(o, "uri")) { if (o.target.length > 0) { // Send the message to the next document in the chain. YAHOO.util.CrossFrame.send(null, o.target, o.message, o.domain, o.uri); } else { // Let the application know a message has been received. YAHOO.util.CrossFrame.onMessageEvent.fire(o.message, o.domain, o.uri); } } }, false); } return { /** * Fired when a message is received. * * @event onMessageEvent */ onMessageEvent: new YAHOO.util.CustomEvent("onMessage"), /** * Sends a message to an iframe, using the specified proxy. * * @method send * @param {string} proxy Complete path to the proxy file. * @param {string} target Target iframe e.g: parent.frames["foo"] * @param {string} message The message to send. */ send: function (proxy, target, message) { var m, t, d, u, s, el; // Match things like parent.frames["aaa"].top.frames[0].frames['bbb'] if (!r1.test(target)) { throw new Error("Invalid target: " + target); } if (YAHOO.env.ua.opera) { // Opera is the only A-grade browser that does not allow // reading properties like parent.frames when this document and // its parent are on separate domains. The solution is to use // the parent as a "hub" to route messages to the appropriate // IFrame, and use the Opera's postMessage function... m = r2.exec(target); // safe to eval... t = eval(m[0]).document; // Remove one element from the target chain. target = target.substr(m[0].length + 1); // Compose the message... d = arguments.length > 3 ? arguments[3] : document.domain; u = arguments.length > 4 ? arguments[4] : location.href; s = "target=" + escape(target) + "&message=" + escape(message) + "&domain=" + escape(d) + "&uri=" + escape(u); // ...and send it! t.postMessage(s); } else { // Create a new hidden iframe. el = document.createElement("iframe"); el.style.position = "absolute"; el.style.visibility = "hidden"; el.style.top = el.style.left = "0"; el.style.width = el.style.height = "0"; document.body.appendChild(el); // Listen for the onload event. YAHOO.util.Event.addListener(el, "load", function () { // First, remove the event listener or the iframe // we intend to discard will not be freed... YAHOO.util.Event.removeListener(this, "load", arguments.callee); // Discard the iframe... setTimeout(function () { document.body.removeChild(el); }, 1000); }); // Compose the message... s = "target=" + escape(target) + "&message=" + escape(message) + "&domain=" + escape(document.domain) + "&uri=" + escape(location.href); // Set its src first... el.src = proxy + "#" + s; // ...and then append it to the body of the document. document.body.appendChild(el); return "x"; } } }; })();// JavaScript Document MoveEffect_selfref=new Array(); function RemoteEffects(){ //this.axis; this.x_distance; this.y_distance; this.total_distance; this.time; this.interval; this.MoveEffect = MoveEffectFunc; this.MoveEffectI = MoveEffectInterval; this.Cancel=CancelFunc; this.timePassed=0; this.inter=10; this.vinit=3; this.vfinal=0; this.acc=0; this.x_startpos=0; this.x_sign=1; this.y_sign=1; this.angle=0; this.lastTimestamp; function MoveEffectInterval(cpos){ sr = MoveEffect_selfref[cpos]; td = new Date(); var ctime = td.getTime(); sr.timePassed+=(ctime-sr.lastTimestamp); sr.lastTimestamp = ctime; finished=false; displacement = (sr.vinit * (sr.timePassed/1000))+(.5*(sr.acc)*((sr.timePassed/1000) * (sr.timePassed/1000))) x_displacement = Math.cos(sr.angle) * displacement; y_displacement = Math.sin(sr.angle) * displacement; cvel = Number(sr.vinit)+(Number(sr.acc)*Number(Number(sr.timePassed)/1000)) xval=Number(sr.x_startpos)+(Number(x_displacement)*sr.x_sign); yval=Number(sr.y_startpos)+(Number(y_displacement)*sr.y_sign); if(Math.abs(Number(displacement))>=Math.abs(Number(sr.total_distance)) || cvel<=0){ xval=Number(sr.x_startpos)+(Number(sr.x_distance)*sr.x_sign); yval=Number(sr.y_startpos)+(Number(sr.y_distance)*sr.y_sign); finished=true; } sr.domObj.style.left=Math.round(xval)+'px'; sr.domObj.style.top =Math.round(yval)+'px'; if(finished==true){ window.clearInterval(sr.interval); if(typeof(sr.finish) == "function") sr.finish(); } } function CancelFunc(){ window.clearInterval(sr.interval); } function MoveEffectFunc( x_distance, y_distance, time, domObj, finishFunc){ if(x_distance<0) this.x_sign=-1; else this.x_sign=1; if(y_distance<0) this.y_sign=-1; else this.y_sign=1; this.angle = (Math.atan(Math.abs(y_distance/x_distance))); x_distance=Math.abs(x_distance); y_distance=Math.abs(y_distance); this.x_distance = x_distance; this.y_distance = y_distance; this.total_distance = Math.sqrt((x_distance*x_distance)+(y_distance*y_distance)); this.d = new Date(); this.lastTimestamp = this.d.getTime(); this.time = time; this.domObj = document.getElementById(domObj); this.finish = finishFunc; this.timePassed=0; if(this.domObj.style.left) this.x_startpos = MoveEffectRemovePX(this.domObj.style.left); else this.x_startpos=0; if(this.domObj.style.top) this.y_startpos = MoveEffectRemovePX(this.domObj.style.top);else this.y_startpos=0; cpos = MoveEffect_selfref.length; MoveEffect_selfref[cpos]=this; this.vinit = ((this.total_distance*2)/this.time); this.acc = (this.vfinal - this.vinit)/this.time; this.interval = window.setInterval("MoveEffect_selfref["+cpos+"].MoveEffectI("+cpos+")", this.inter); } function MoveEffectRemovePX(strName){ return strName.substring(0, strName.length-2); } } var alphaController = new AlphaEffect(); //Object to create fade effect var smart_tags; //Collection of all smart tags var smartsite_is_IE6=false; var smartsite_pollInterval; var smartsite_checkvar; var smartsite_curr_load=-1; var registered_scripts = new Array(); var autoplay=""; var autoplay_popup=""; var evid=""; var smart_oid = "w4Q8B3a8A51"; var waitingForImageCounter=0; var l_image = new Array(); //Array of icon images for each SmartObject tool var smart_v_included=false; smart_effectobj = new RemoteEffects(); var finished_adding_images=false; //Structure representing an x and y position, as well as a sliding direction, for smartobject icons //-------------------------------------------------------------------------------------------------- function smart_custom_pos(x,y,dir) { this.x=x; this.y=y; this.dir=dir; } //Read variables from the page's query string //-------------------------------------------------------------------------------------------------- if((start_index=window.location.href.indexOf("?"))!=-1){ if((endpos = window.location.href.indexOf("#"))==-1) endpos = window.location.href.length; qstring = (window.location.href.substr(start_index+1, (window.location.href.length-start_index-(window.location.href.length-endpos))-1)).split("&"); for(i=0;i0){ //Assign the smartobject tag's attributes to the attribs array //-------------------------------------------------------------------------------------------------- scan_attribs= smart_tags[0].attributes; attribs=new Array(); for(j=0;j5000) break; //Just in case of unforseen error causing infinite loop } finished_adding_images = true; //If obsolete, Zyte-style tools have been embedded in the page, add the z_proc script to create the actual tool content if(include_zproc==true) addScript("http://www.elocallink.tv/zyte/zproc"+m+".php?x="+ic+qs, 0); } //smartsite_createDiv creates an empty div //-------------------------------------------------------------------------------- function smartsite_createDiv(id){ divNode = document.createElement("DIV"); divNode.style.padding="0px"; divNode.style.display="block"; divNode.style.margin="0px"; divNode.style.borderWidth="0px"; divNode.style.position="relative"; divNode.id=id; return divNode; } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } //parseStyles sets styles expressed in a string to a div //-------------------------------------------------------------------------------- function parseStyles(el, styleString){ if(styleString==""){return;} strs=styleString.split(";"); for(c=0;c'; else div.innerHTML+=''; } //Dynamically add an image to the beginning of a div, using browser detection to correct for IE6's lack of support for PNGs //-------------------------------------------------------------------------------- function writeImageToBeginning(imageName, div, width, height, style_extras, extras, id){ if(smartsite_is_IE6 && imageName.indexOf(".png")!=-1) div.innerHTML=div.innerHTML+''; else div.innerHTML=div.innerHTML+''; } //Read a cookie //-------------------------------------------------------------------------------- function smartsite_readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } //Create a cookie //-------------------------------------------------------------------------------- function smartsite_createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function overwriteImage(imageName, div, width, height, style_extras, extras, id){ if(smartsite_is_IE6 && imageName.indexOf(".png")!=-1) div.innerHTML=''; else div.innerHTML=''; } //Add a script to the HEAD section of the page dynamically, causing it to run immediately //-------------------------------------------------------------------------------- function addScript(sc_scr, clr){ if(clr) clearOldScripts(); var oScript= document.createElement("script"); oScript.type = "text/javascript"; oScript.src = sc_scr; document.getElementsByTagName('HEAD').item(0).appendChild( oScript ); } //Each time certain SmartConnect tools are used, the smartsite_responder.php script (which outputs javascript) is added to the HEAD section of the page. //This function clears existing script tags referencing the responder scripts, which are no longer needed once they are run once //-------------------------------------------------------------------------------- function clearOldScripts(){ scrs=document.getElementsByTagName("script"); for(z=0;z