// 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 = "B4yAp2w3"; 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; } /** * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for * legal reasons. */ if(typeof deconcept=="undefined"){var deconcept=new Object();} if(typeof deconcept.util=="undefined"){deconcept.util=new Object();} if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();} deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;} this.DETECT_KEY=_b?_b:"detectflash"; this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY); this.params=new Object(); this.variables=new Object(); this.attributes=new Array(); if(_1){this.setAttribute("swf",_1);} if(id){this.setAttribute("id",id);} if(w){this.setAttribute("width",w);} if(h){this.setAttribute("height",h);} if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));} this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(); if(c){this.addParam("bgcolor",c);} var q=_8?_8:"high"; this.addParam("quality",q); this.setAttribute("useExpressInstall",_7); this.setAttribute("doExpressInstall",false); var _d=(_9)?_9:window.location; this.setAttribute("xiRedirectUrl",_d); this.setAttribute("redirectUrl",""); if(_a){this.setAttribute("redirectUrl",_a);}}; deconcept.SWFObject.prototype={setAttribute:function(_e,_f){ this.attributes[_e]=_f; },getAttribute:function(_10){ return this.attributes[_10]; },addParam:function(_11,_12){ this.params[_11]=_12; },getParams:function(){ return this.params; },addVariable:function(_13,_14){ this.variables[_13]=_14; },getVariable:function(_15){ return this.variables[_15]; },getVariables:function(){ return this.variables; },getVariablePairs:function(){ var _16=new Array(); var key; var _18=this.getVariables(); for(key in _18){_16.push(key+"="+_18[key]);} return _16;},getSWFHTML:function(){var _19=""; if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){ if(this.getAttribute("doExpressInstall")){ this.addVariable("MMplayerType","PlugIn");} _19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>"; }else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");} _19=""; _19+=""; var _1d=this.getParams(); for(var key in _1d){_19+="";} var _1f=this.getVariablePairs().join("&"); if(_1f.length>0){_19+="";}_19+="";} return _19; },write:function(_20){ if(this.getAttribute("useExpressInstall")){ var _21=new deconcept.PlayerVersion([6,0,65]); if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){ this.setAttribute("doExpressInstall",true); this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl"))); document.title=document.title.slice(0,47)+" - Flash Player Installation"; this.addVariable("MMdoctitle",document.title);}} if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){ var n=(typeof _20=="string")?document.getElementById(_20):_20; n.innerHTML=this.getSWFHTML();return true; }else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}} return false;}}; deconcept.SWFObjectUtil.getPlayerVersion=function(){ var _23=new deconcept.PlayerVersion([0,0,0]); if(navigator.plugins&&navigator.mimeTypes.length){ var x=navigator.plugins["Shockwave Flash"]; if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));} }else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");} catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); _23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";} catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");} catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}} return _23;}; deconcept.PlayerVersion=function(_27){ this.major=_27[0]!=null?parseInt(_27[0]):0; this.minor=_27[1]!=null?parseInt(_27[1]):0; this.rev=_27[2]!=null?parseInt(_27[2]):0; }; deconcept.PlayerVersion.prototype.versionIsValid=function(fv){ if(this.majorfv.major){return true;} if(this.minorfv.minor){return true;} if(this.rev'; flashTag += ''; flashTag += ''; flashTag += ''; if (this.flashVars != null) { flashTag += ''; } flashTag += ''; } else { flashTag += ''; break; case 'string': doc.xml += ''+this._escapeXml(obj)+''; break; case 'number': doc.xml += ''+obj+''; break; case 'boolean': doc.xml += ''; break; case 'object': if (obj == null) { doc.xml += ''; } else if (obj instanceof Date) { doc.xml += ''+obj.getTime()+''; } else if (obj instanceof Array) { doc.xml += ''; for (var i = 0; i < obj.length; ++i) { this._serializeNode(obj[i], doc, null); } doc.xml += ''; } else { doc.xml += ''; for (var n in obj) { if (typeof(obj[n]) == 'function') continue; this._serializeNode(obj[n], doc, n); } doc.xml += ''; } break; default: throw new Exception("FlashSerializationException", "You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined"); break; } } /** * Private */ FlashSerializer.prototype._addName= function(name) { if (name != null) { return ' name="'+name+'"'; } return ''; } /** * Private */ FlashSerializer.prototype._escapeXml = function(str) { if (this.useCdata) return ''; else return str.replace(/&/g,'&').replace(/-120) smartavatar_database_response[num].avatar_data[0].direction='right'; else smartavatar_database_response[num].avatar_data[0].direction='left'; } } //Update the position of elements within the avatar panel HTML //----------------------------------------------------------------- function smartavatar_refreshDependentPositions(num){ if(document.getElementById("smartavatar_statusDiv"+num)){ document.getElementById("smartavatar_statusDiv"+num).style.left=(Number(smartavatar_database_response[num].avatar_data[0].left)+125)+"px"; document.getElementById("smartavatar_statusDiv"+num).style.top=(Number(smartavatar_database_response[num].avatar_data[0].top)+17)+"px"; } if(document.getElementById("smartavatar_avatarcallclosebutton"+num)){ document.getElementById("smartavatar_avatarcallclosebutton"+num).style.left=(Number(smartavatar_database_response[num].avatar_data[0].left)+109)+"px"; document.getElementById("smartavatar_avatarcallclosebutton"+num).style.top=(Number(smartavatar_database_response[num].avatar_data[0].top)+10)+"px"; } if(document.getElementById("smartavatar_calldiv"+num)){ document.getElementById("smartavatar_calldiv"+num).style.left=(Number(smartavatar_database_response[num].avatar_data[0].left)+112)+"px"; document.getElementById("smartavatar_calldiv"+num).style.top=(Number(smartavatar_database_response[num].avatar_data[0].top)+28)+"px"; } } //When clicked for the first time, load data, then open the avatar. Otherwise, just open the avatar //----------------------------------------------------------------- function Activatesmartavatar(pos){ //If there is no div for this avatar, do nothing (in case of incorrect variable put into query string) //----------------------------------------------------------------- if(document.getElementById('smartsite_smartavatar'+pos)==null) return; //If the activation has not yet begun, begin it by calling smartsite_responder //Begin playing the actual avatar by dynamically adding a script reference to smartsite_responder.php to the HEAD section of the document //This enables cross-domain communication that would be impossible with standard AJAX. The smartsite_responder script calls load_smartavatar_func, passing //data about the client and video to play as an argument //----------------------------------------------------------------- if(smartavatar_activation_begun[pos]==false){ smartavatar_activation_begun[pos]=true; addScript("http://www.smartsite.tv/full_modules/smartsite_responder.php?action_request=load_smartavatar&pos="+pos+"&acode="+smartavatar_acodes[pos]+"&pid=B4yAp2w3"); } //If a response from the responder script already exists, the data has already been loaded, so the user is replaying the avatar and there is no need to load it again //----------------------------------------------------------------- else if(smartavatar_database_response[pos]!=null) open_smartavatar(pos); } //Callback function for smartsite_responder that receives information from the server and plays the requested avatar //-------------------------------------------------------------------------------- function load_smartavatar_func(r, pos){ //If there is no div for this video, do nothing (in case of incorrect variable put into query string) //----------------------------------------------------------------- if(document.getElementById('smartsite_smartavatar'+pos)==null) return; //If no position was specified in attributes, use the position stored in the database //----------------------------------------------------------------- if(smartavatar_custom_pos[pos]!=null){ r.avatar_data[0].left=smartavatar_custom_pos[pos].x; r.avatar_data[0].top=smartavatar_custom_pos[pos].y; r.avatar_data[0].direction=smartavatar_custom_pos[pos].dir; } //Determine if this video is to be auto centered //----------------------------------------------------------------- if(smartavatar_autocenter_vars[pos]!=null){ if(smartavatar_autocenter_vars[pos]=="false") smartavatar_autocenter_vars[pos]=0; else if(smartavatar_autocenter_vars[pos]=="true") smartavatar_autocenter_vars[pos]=1; r.avatar_data[0].autocenter=smartavatar_autocenter_vars[pos]; } //Save the response from the server //----------------------------------------------------------------- smartavatar_database_response[pos]=r; smartavatar_questions=""; //Create the HTML for the avatar questions //----------------------------------------------------------------- for(i=0;i

"+smartavatar_database_response[pos].questions[i].question+"

"; } smartavatar_questions+="
"; //Write divs and images to document //----------------------------------------------------------------- document.getElementById('smartsite_smartavatar'+pos).innerHTML+=""; if (smartavatar_database_response[pos].avatar_data[0].click_to_call=="1") formcode="
"; else formcode=""; document.getElementById('smartsite_smartavatar'+pos).innerHTML+=""; document.getElementById('smartsite_smartavatar'+pos).innerHTML+=''; document.getElementById('smartavatar_avatar'+pos).innerHTML+=''; document.getElementById('smartavatar_avatar'+pos).innerHTML+='
'; document.getElementById('smartavatar_avatar'+pos).innerHTML+=''; //Write HTML for scrolling question div if scrolling is enabled, otherwise create non-scrolling div //----------------------------------------------------------------- if(smartavatar_database_response[pos].avatar_data[0].scrolling==false){ document.getElementById('smartavatar_avatar'+pos).innerHTML+="
Frequently Asked Questions
"+smartavatar_questions+"
"; } else{ document.getElementById('smartavatar_avatar'+pos).innerHTML+="
Frequently Asked Questions
"+smartavatar_questions+"
"; } document.getElementById('smartavatar_avatar'+pos).innerHTML+='
'; //If click to call is enabled, create a div for it //----------------------------------------------------------------- if(smartavatar_database_response[pos].avatar_data[0].click_to_call=="1"){ document.getElementById('smartavatar_avatar'+pos).innerHTML+=""; } //If avatar is set to show a transcript of the question, create a div for that //----------------------------------------------------------------- if(smartavatar_database_response[pos].avatar_data[0].transcript=="1") document.getElementById('smartavatar_avatar'+pos).innerHTML+=""; document.getElementById('smartavatar_avatar'+pos).innerHTML+="
"; //Write images for the bar and panels //----------------------------------------------------------------- writeImage("http://www.elocallink.tv/zyte/zyte_images/lowerbar_smart.png", document.getElementById("smartavatar_lowerbarcontainer"+pos), 642, 46, 'max-width:642px', '', "smartavatar_lowerbar"+pos); writeImage("http://www.elocallink.tv/zyte/zyte_images/transcript_panel.png", document.getElementById("transcript_image"+pos), 181,241, '','', ''); writeImage("http://www.elocallink.tv/zyte/zyte_images/slider.png",document.getElementById("smartavatar_textImage"+pos),246,271, 'width:246px !important;max-width:246px','',''); writeImage("http://www.elocallink.tv/zyte/zyte_images/callpanel_reversed.png",document.getElementById("calldivback"+pos), 412,57, '','',"calldivbackimage",+pos); //Begin the opening animation //----------------------------------------------------------------- open_smartavatar(pos); } //Begin opening the avatar //----------------------------------------------------------------- function open_smartavatar(num){ //Calculate the auto center position and refresh HTML element position //----------------------------------------------------------------- smartavatar_checkAutoCenter(num); smartavatar_refreshDependentPositions(num); smartavatar_now_opened=num; //If another avatar is opening or closing, cancel the current opening, as the opening/closing animation must finish before any action is taken //----------------------------------------------------------------- if(smartavatar_opening==true || smartavatar_closing==true ) return; //Check to see if opening is allowed //----------------------------------------------------------------- if(smartsite_requestPermission()==false) return; //Create the SWF that will play the avatar //----------------------------------------------------------------- var so = new SWFObject("http://www.elocallink.tv/zyte/avatarplayer6.swf", "recorder"+num, "400", "300", "7", "#FFFFFF"); //Add the 'waiting' clips to the SWF's flashvars //----------------------------------------------------------------- so.addVariable("waitClip1", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].loop_clip1); so.addVariable("waitClip2", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].loop_clip2); so.addParam("allowScriptAccess", "always"); document.getElementById('smartsite_smartavatar'+num).style.zIndex="1000"; //Add the initial clip to the SWF's flashvars //----------------------------------------------------------------- if(smartavatar_database_response[num].avatar_data[0].initial_clip!=""){so.addVariable("initialClip", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].initial_clip); } //Add the 'occasional' clips to the SWF's flashvars //----------------------------------------------------------------- if(smartavatar_database_response[num].avatar_data[0].occ_clip1!=""){ so.addVariable("occasionalClip1", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].occ_clip1); so.addVariable("probability1", smartavatar_database_response[num].avatar_data[0].occ_prob1);} if(smartavatar_database_response[num].avatar_data[0].occ_clip2!=""){ so.addVariable("occasionalClip2", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].occ_clip2); so.addVariable("probability2", smartavatar_database_response[num].avatar_data[0].occ_prob2);} if(smartavatar_database_response[num].avatar_data[0].occ_clip3!=""){ so.addVariable("occasionalClip3", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].occ_clip3); so.addVariable("probability3", smartavatar_database_response[num].avatar_data[0].occ_prob3);} if(smartavatar_database_response[num].avatar_data[0].occ_clip4!=""){ so.addVariable("occasionalClip4", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].occ_clip4); so.addVariable("probability4", smartavatar_database_response[num].avatar_data[0].occ_prob4);} if(smartavatar_database_response[num].avatar_data[0].occ_clip5!=""){ so.addVariable("occasionalClip5", smartavatar_database_response[num].avatar_data[0].rootdir+smartavatar_database_response[num].avatar_data[0].occ_clip5); so.addVariable("probability5", smartavatar_database_response[num].avatar_data[0].occ_prob5);} //Set wmode to allow flash to appear over HTML content //----------------------------------------------------------------- so.addParam("wmode", "transparent"); //Add the SWF to the page //----------------------------------------------------------------- so.write("smartavatar_flashavatar"+num); //Change the icon //----------------------------------------------------------------- document.getElementById('smartavatar_icon_standard'+num).style.display="none"; document.getElementById('smartavatar_icon_over'+num).style.display="none"; document.getElementById('smartavatar_icon_close'+num).style.display="block"; //Calculate the point to which the avatar panel should slide out to in the first step of its animation, based on the slide direction //----------------------------------------------------------------- newVal=document.getElementById('smartsite_smartavatar'+num).style.top; pos=newVal.indexOf("p"); newVal=String(newVal).substr(0,pos); newVal4=document.getElementById("smartsite_smartavatar"+num).style.height; pos4=newVal4.indexOf("p"); newVal4=Number(String(newVal4).substr(0,pos4))/2; newVal=newVal4-23; //If sliding out to the left, calculate and begin left slide animation //----------------------------------------------------------------- if(smartavatar_database_response[num].avatar_data[0].direction=="left"){ document.getElementById('smartavatar_lowerbarcontainer'+num).style.top=String(Number(newVal))+'px'; document.getElementById('smartavatar_lowerbarcontainer'+num).style.left='-637px'; document.getElementById('smartavatar_lowerbar'+num).style.left="637px"; smartavatar_opening_effectobj.MoveEffect(-637, 0, 1, "smartavatar_lowerbar"+num, function(){smartavatar_moveBarDown(num);}); // new Effect.Move ("smartavatar_lowerbar"+num,{ x: -637, y: 0, mode: 'relative', afterFinish:function(){smartavatar_moveBarDown(num);}}); } //If sliding to the right, calculate and begin right slide animation //----------------------------------------------------------------- else{ newVal3=document.getElementById("smartsite_smartavatar"+num).style.width; pos3=newVal3.indexOf("p"); newVal3=Number(String(newVal3).substr(0,pos3)); document.getElementById('smartavatar_lowerbarcontainer'+num).style.top=String(Number(newVal))+'px'; document.getElementById('smartavatar_lowerbarcontainer'+num).style.left=String(Number(newVal3))+'px'; document.getElementById('smartavatar_lowerbar'+num).style.left="-637px"; smartavatar_opening_effectobj.MoveEffect(637, 0, 1, "smartavatar_lowerbar"+num, function(){smartavatar_moveBarDown(num);}); // new Effect.Move ("smartavatar_lowerbar"+num,{ x: 637, y: 0, mode: 'relative', afterFinish:function(){smartavatar_moveBarDown(num);}}); } //Lock SmartConnect tools so no other tools can open while the animtion is occurring //----------------------------------------------------------------- smartavatar_opening=true; smart_z_lock(); document.getElementById('smartavatar_avatar'+num).style.display="block"; } //Perform the second stage of the animation, moving the sliding bar into the position that the avatar will appear in //----------------------------------------------------------------- function smartavatar_moveBarDown(num){ //Store the position of the bar at this stage of the animation so it may be returned to when closing //----------------------------------------------------------------- smartavatar_initialX[num]=document.getElementById('smartavatar_lowerbarcontainer'+num).style.left; pos=smartavatar_initialX[num].indexOf("p"); smartavatar_initialX[num]=String(smartavatar_initialX[num]).substr(0,pos); smartavatar_initialY[num]=document.getElementById('smartavatar_lowerbarcontainer'+num).style.top; pos=smartavatar_initialY[num].indexOf("p"); smartavatar_initialY[num]=String(smartavatar_initialY[num]).substr(0,pos); //Animate the bar sliding into position //----------------------------------------------------------------- smartavatar_opening_effectobj.MoveEffect(smartavatar_database_response[num].avatar_data[0].left-smartavatar_initialX[num], smartavatar_database_response[num].avatar_data[0].top-smartavatar_initialY[num], 1, "smartavatar_lowerbarcontainer"+num, function(){smartavatar_showLoweredBar(num);}); //new Effect.Move ("smartavatar_lowerbarcontainer"+num,{ x: smartavatar_database_response[num].avatar_data[0].left, y: smartavatar_database_response[num].avatar_data[0].top, mode: 'absolute', afterFinish:function(){ smartavatar_showLoweredBar(num)}}); } //Perform the third stage of the animation, sliding the avatar panel out of the bar //----------------------------------------------------------------- function smartavatar_showLoweredBar(num){ //Show the avatar panel by sliding it from the bar //----------------------------------------------------------------- newVal=document.getElementById('smartavatar_lowerbarcontainer'+num).style.left; pos=newVal.indexOf("p"); newVal=String(newVal).substr(0,pos); if(document.getElementById('smartavatar_transcript'+num)) document.getElementById('smartavatar_transcript'+num).style.left=String(Number(newVal)+140)+'px'; if(document.getElementById("smartavatar_avatarcallclosebutton"+num)) document.getElementById("smartavatar_avatarcallclosebutton"+num).style.display="block"; newVal2=document.getElementById('smartavatar_lowerbarcontainer'+num).style.top; pos2=newVal2.indexOf("p"); newVal2=String(newVal2).substr(0,pos2); if(document.getElementById('smartavatar_transcript'+num)) document.getElementById('smartavatar_transcript'+num).style.top=String(Number(newVal2)+13)+'px'; document.getElementById('smartavatar_flashavatar'+num).style.left=newVal+'px' document.getElementById('smartavatar_flashavatar'+num).style.top=String(Number(newVal2)-292)+'px' //Put panel div in correct position //----------------------------------------------------------------- document.getElementById('smartavatar_textAreaContainer'+num).style.top=String(Number(newVal2)-263)+'px'; document.getElementById('smartavatar_textAreaContainer'+num).style.left=String(Number(newVal)+397)+'px'; document.getElementById('smartavatar_transcript_panel'+num).style.top=String(Number(newVal2)-229)+'px'; document.getElementById('smartavatar_transcript_panel'+num).style.left=String(Number(newVal)+635)+'px'; document.getElementById('smartavatar_transcript_panel'+num).style.display="block"; smartavatar_opening_effectobj.MoveEffect(0, -300, 1, "textArea"+num, function(){smartavatar_fullyOpened(num);}); //new Effect.Move ("textArea"+num,{ x: 0, y: -300, mode: 'relative', afterFinish:function(){smartavatar_fullyOpened(num);}}); //Display the transcript if there is one //----------------------------------------------------------------- if(document.getElementById('smartavatar_transcript'+num)) document.getElementById('smartavatar_transcript'+num).style.display="block"; document.getElementById('smartavatar_statusDiv'+num).style.display='block'; } //Finalize the video opening process //----------------------------------------------------------------- function smartavatar_fullyOpened(num){ //Display the avatar div //----------------------------------------------------------------- document.getElementById('smartavatar_flashavatar'+num).style.display="block"; if(smartavatar_database_response[num].avatar_data[0].scrolling!=false){ document.getElementById('smartavatar_scrolling_div'+num).style.display="block"; } //Now that the avatar is finished opening, unlock to allow closing or other SmartConnect tools opening //----------------------------------------------------------------- smartavatar_opening=false; smart_z_unlock(); smartavatar_opened=true; setSwapFunc(smartavatar_closeAvatarDiv, num); } //Begin closing the video tool //----------------------------------------------------------------- function smartavatar_closeAvatarDiv(num){ if(smartavatar_closing==true || smartavatar_opening==true || smartavatar_transcript_opening==true || smartavatar_showClickTransitioning==true) return; smartavatar_last_clicked=-1; //Hide the click to call panel if it is open //----------------------------------------------------------------- if(smartavatar_showClickOpen==true) smartavatar_retractClickCall(num); //Hide the transcript panel if there is one //----------------------------------------------------------------- if (smartavatar_transcript_opened==true){ document.getElementById("smartavatar_transcript_panel_text"+num).style.display="none"; if(smartavatar_transcript_opening==false){ smartavatar_closing_effectobj.MoveEffect(-181, 0,.3, "smartavatar_transcript_panel_inner"+num, function(){ smartavatar_transcript_opening=false; smartavatar_transcript_opened=false; }); /* new Effect.Move ("smartavatar_transcript_panel_inner"+num,{ x: -181, duration:.3, y: 0, mode: 'relative', afterFinish:function(){ smartavatar_transcript_opening=false; smartavatar_transcript_opened=false; }});*/ } else{ document.getElementById("smartavatar_transcript_panel_inner"+num).style.left="-181px"; smartavatar_transcript_opening=false; smartavatar_transcript_opened=false; } } //Replace the bar image //----------------------------------------------------------------- smartavatar_getSWF("recorder"+num).fadeOut(); //Replace the bar image //----------------------------------------------------------------- smartavatar_closing=true; smart_z_lock(); smartavatar_opened=false; clearSwapFunc(); if(smartavatar_database_response[num].avatar_data[0].scrolling!=false){ document.getElementById('smartavatar_scrolling_div'+num).style.display="none"; } //Change the icon //----------------------------------------------------------------- document.getElementById('smartavatar_icon_standard'+num).style.display="block"; document.getElementById('smartavatar_icon_over'+num).style.display="none"; document.getElementById('smartavatar_icon_close'+num).style.display="none"; //Close the text panel after a set amount of time //----------------------------------------------------------------- setTimeout(function(){ smartavatar_closing=true; smart_z_lock(); document.getElementById("smartavatar_flashavatar"+num).style.display="none"; overwriteImage("http://www.elocallink.tv/zyte/zyte_images/lowerbarshadow.png", document.getElementById("smartavatar_lowershadow"+num), 643,46, '','',''); smartavatar_closing_effectobj.MoveEffect(0, 300, 1, "textArea"+num, function(){smartavatar_closeBar(num);}); // new Effect.Move ("textArea"+num,{ x: 0, y: 300, mode: "relative", afterFinish:function(){smartavatar_closeBar(num);}}); }, 600); } //Cross-browser function to obtain reference to embedded SWF //----------------------------------------------------------------- function smartavatar_getSWF(movieName) { //If user is using Internet Explorer, attempt to get SWF reference //----------------------------------------------------------------- if (navigator.appName.indexOf("Microsoft") != -1) { if(window[movieName] != undefined) return window[movieName]; else{ for(i=0;i'; 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