// 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 = "w2ww1Np72"; 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"+text+" "; } } function load_ctt(target_div, image, text, w, h, pos){ if(image!=null){ writeImage(image, target_div, w, h, 'cursor:pointer;', 'onclick="window.open(\'http://www.smartsite.tv/full_modules/click_to_text/remote_ctt.php?pid=w2ww1Np72\',\'click_to_text_window\',\'width=400,height=300,toolbar=no,location=no,status=no,menubar=no\'); return false;"', 'ctc'+pos); } else{ target_div.innerHTML=""+text+" "; } } //This script creates a slide-out video //----------------------------------------------------------------- smartvideo_opening=false; smartvideo_database_response=new Array(); smartvideo_opening=false; smartvideo_closing=false; smartvideo_opened=false; smartvideo_swapping=false; smartvideo_now_opened=-1; smartvideo_originalZ=0; smartvideo_initialX=0; smartvideo_initialY=0; smartvideo_muted=false; smartvideo_phoneSelected=false; smartvideo_waitForInput=null; smartvideo_mcodes = new Array(); smartvideo_activation_begun=new Array(); smartvideo_custom_pos=new Array(); smartvideo_pos_values=new Array(); smartvideo_cookie_based_open_allowed=new Array(); smartvideo_show_tabs=new Array(); smartvideo_callpanel_timeouts=new Array(); smartvideo_sharepanel_timeouts=new Array(); smartvideo_autocenter_vars=new Array(); smartvideo_opening_effectobj = new RemoteEffects(); smartvideo_closing_effectobj = new RemoteEffects(); smartvideo_trackingClientIDs = new Array(); smartvideo_CCEmail = new Array(); smartvideo_NetReceipts = new Array(); //Structure to represent a smartvideo icon's position and slide-out direction //----------------------------------------------------------------- function custom_pos(x,y,dir) { this.x=x; this.y=y; this.dir=dir; } //Load the smartvideo //----------------------------------------------------------------- function load_smartvideo(target_div, image, image2, image3, w, h, mcode, open_x, open_y, open_direction, autoc, pos, autoopen, allowTabs, netReceiptID){ //Store the net receipt id and position of this smartvideo //----------------------------------------------------------------- smartvideo_NetReceipts[pos] = netReceiptID; smartvideo_pos_values.push(pos); //If auto-opening is turned off in atributes, do not allow the smart_z_manager script to auto-open this smartvideo //----------------------------------------------------------------- if(autoopen=="false") smartvideo_cookie_based_open_allowed.push(false); else smartvideo_cookie_based_open_allowed.push(true); //Create divs for buttons and the slide-out player //----------------------------------------------------------------- target_div.style.width=w+"px"; target_div.style.height=h+"px"; smartvideo_show_tabs[pos] = true; if(allowTabs=="false"){ smartvideo_show_tabs[pos] = false; } divNode = document.createElement("DIV"); divNode.style.position="absolute"; divNode.id="smartvideo_icon_standard"+pos; divNode.style.width=w+"px"; divNode.style.height=h+"px"; target_div.appendChild(divNode); divNode = document.createElement("DIV"); divNode.style.position="absolute"; divNode.id="smartvideo_icon_over"+pos; divNode.style.width=w+"px"; divNode.style.height=h+"px"; divNode.style.display="none"; target_div.appendChild(divNode); divNode = document.createElement("DIV"); divNode.style.position="absolute"; divNode.id="smartvideo_icon_close"+pos; divNode.style.width=w+"px"; divNode.style.height=h+"px"; divNode.style.display="none"; target_div.appendChild(divNode); //Store the movie code for this tool //----------------------------------------------------------------- smartvideo_mcodes[pos]=mcode; //Set the activation status for this tool //----------------------------------------------------------------- smartvideo_activation_begun[pos]=false; //Set the opening position and direction if this was set in attributes //----------------------------------------------------------------- if(open_x!=null && open_y!=null && open_direction!=null){ smartvideo_custom_pos[pos]=new custom_pos(open_x,open_y,open_direction); } else smartvideo_custom_pos[pos]=null; //Set auto-center variable //----------------------------------------------------------------- if(autoc!=null) smartvideo_autocenter_vars[pos]=autoc; else smartvideo_autocenter_vars[pos]=null; //Write icon images //----------------------------------------------------------------- writeImage(image, document.getElementById("smartvideo_icon_standard"+pos), w, h, 'cursor:pointer;', 'onMouseOver="smartvideo_showRollover('+pos+')"', 'smartvideo_image'+pos); writeImage(image2, document.getElementById("smartvideo_icon_over"+pos), w, h, 'cursor:pointer;', "onMouseOut='smartvideo_hideRollover("+pos+")' onclick='ActivateSmartVideo("+pos+")'", 'smartvideo_image_over'+pos); writeImage(image3, document.getElementById("smartvideo_icon_close"+pos), w, h, 'cursor:pointer;', 'onclick="smartvideo_closeAvatarDiv('+pos+')"', 'smartvideo_image_close'+pos); } //Show button rollover //----------------------------------------------------------------- function smartvideo_showRollover(pos){ document.getElementById('smartvideo_icon_standard'+pos).style.display="none"; document.getElementById('smartvideo_icon_over'+pos).style.display="block"; document.getElementById('smartvideo_icon_close'+pos).style.display="none"; } //Hide button rollover //----------------------------------------------------------------- function smartvideo_hideRollover(pos){ if(!smartvideo_opening){ document.getElementById('smartvideo_icon_standard'+pos).style.display="block"; document.getElementById('smartvideo_icon_over'+pos).style.display="none"; document.getElementById('smartvideo_icon_close'+pos).style.display="none"; } } //When clicked for the first time, load data, then open the video. Otherwise, just open the video //----------------------------------------------------------------- function ActivateSmartVideo(pos){ //If there is no div for this video, do nothing (in case of incorrect variable put into query string) //----------------------------------------------------------------- if(document.getElementById('smartsite_smartvideo'+pos)==null) return; //If the activation has not yet begun, begin it by calling smartsite_responder //Begin playing the actual video 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 playvideo_r, passing //data about the client and video to play as an argument //----------------------------------------------------------------- if(smartvideo_activation_begun[pos]==false){ smartvideo_activation_begun[pos]=true; addScript("http://www.smartsite.tv/full_modules/smartsite_responder.php?action_request=load_smartvideo&pos="+pos+"&mcode="+smartvideo_mcodes[pos]+"&pid=w2ww1Np72", 1); } //If a response from the responder script already exists, the data has already been loaded, so the user is replaying the video and there is no need to load it again //----------------------------------------------------------------- else if(smartvideo_database_response[pos]!=null) open_smartvideo(pos); } //Callback function for smartsite_responder that receives information from the server and plays the requesed video //-------------------------------------------------------------------------------- function load_smartvideo_func(r, pos){ //Retrieve the tracking id and email address for the client //-------------------------------------------------------------------------------- smartvideo_trackingClientIDs[pos] = r.enc_tcid; smartvideo_CCEmail[pos] = r.cc_email; //If there is no div for this video, do nothing (in case of incorrect variable put into query string) //----------------------------------------------------------------- if(document.getElementById('smartsite_smartvideo'+pos)==null) return; //If no position was specified in attributes, use the position stored in the database //----------------------------------------------------------------- if(smartvideo_custom_pos[pos]!=null){ r.left=smartvideo_custom_pos[pos].x; r.top=smartvideo_custom_pos[pos].y; r.direction=smartvideo_custom_pos[pos].dir; } try{ //If client has a click to call number and show_tabs attribute is not set to false, show the click to call tab //----------------------------------------------------------------- if(r.clicktocall != null){ //Check for valid phone number in database //----------------------------------------------------------------- re = /^\d{10,11}$/; regexp = new RegExp(re); if(regexp.test(r.clicktocall) && smartvideo_show_tabs[pos]!=false){ smartvideo_show_tabs[pos] = true; } else { smartvideo_show_tabs[pos] = false; } } else{ smartvideo_show_tabs[pos] = false; } } catch(err){ } //Determine if this video is to be auto centered //----------------------------------------------------------------- if(smartvideo_autocenter_vars[pos]!=null){ if(smartvideo_autocenter_vars[pos]=="false") smartvideo_autocenter_vars[pos]=0; else if(smartvideo_autocenter_vars[pos]=="true") smartvideo_autocenter_vars[pos]=1; r.autocenter=smartvideo_autocenter_vars[pos]; } //Save the response from the server //----------------------------------------------------------------- smartvideo_database_response[pos]=r; //Create the HTML for the slide-out video player //----------------------------------------------------------------- smartvideo_originalZ=document.getElementById('smartsite_smartvideo'+pos).style.zIndex; current_writing_div=document.getElementById("smartsite_smartvideo"+pos); current_writing_div.innerHTML+=""; current_writing_div.innerHTML+=''; document.getElementById('smartvideo_avatar'+pos).innerHTML+='
'; document.getElementById('smartvideo_avatar'+pos).innerHTML+=''; document.getElementById('smartvideo_avatar'+pos).innerHTML+=''; callAndClickPanel = ""; if(smartvideo_show_tabs[pos]) callAndClickPanel += ""; document.getElementById('smartvideo_avatar'+pos).innerHTML+="
"+callAndClickPanel+"
Would you like to share this with a friend?
Recipient Address (e.g. jane@site.com)

Sender Address (e.g. jane@site.com)

Send via e-mail Send via SmartPhone
CC email to this video's owner
Request net receipt

"; document.getElementById('smartvideo_avatar'+pos).innerHTML+=""; document.getElementById('smartvideo_avatar'+pos).innerHTML+=""; current_writing_div.innerHTML+='
'; writeImage("http://www.elocallink.tv/zyte/zyte_images/tourlowerbar.png", document.getElementById("smartvideo_lowerbarcontainer"+pos), 418, 46, '', '', 'smartvideo_lowerbar'+pos); writeImageToBeginning("http://www.elocallink.tv/zyte/zyte_images/tourupper_smart.png",document.getElementById("smartvideo_textImage"+pos), 418,338, '','', ''); //If a net receipt has been requested for this page view through a query string variable, meaning it was sent to a friend //post the remote_netrec_check.php to an iframe to handle the net receipt //----------------------------------------------------------------- if(smartvideo_NetReceipts[pos]!=""){ document.getElementById("smartvideo_postframe"+pos).src="http://www.smartsite.tv/client_sites/shared/remote_netrec_check.php?evid="+smartvideo_NetReceipts[pos]; } //Slide out the video pane //----------------------------------------------------------------- open_smartvideo(pos); } //Check if the video should be auto-centered, if so, calculate the center //----------------------------------------------------------------- function smartvideo_checkAutoCenter(num){ //If the video should be auto-centered, calculate the center //----------------------------------------------------------------- if(smartvideo_database_response[num].autocenter==true){ //Set default screen dimensions //----------------------------------------------------------------- var smartvideo_screenWidth=800; var smartvideo_screenHeight=600; //Try to get the screen dimensions in a cross-browser manner //----------------------------------------------------------------- if(window.innerWidth){ smartvideo_screenWidth=window.innerWidth; smartvideo_screenHeight=window.innerHeight; //Check to see if the page has been scrolled down from the top //----------------------------------------------------------------- if(document.body.scrollTop) scrolldist=document.body.scrollTop; else scrolldist=document.documentElement.scrollTop; } else{ //Use alternate method to get screen dimensions and scroll distance //----------------------------------------------------------------- smartvideo_screenWidth=document.documentElement.clientWidth; smartvideo_screenHeight=document.documentElement.clientHeight; scrolldist=document.documentElement.scrollTop; //Use another alternate method to get screen dimensions and scroll distance //----------------------------------------------------------------- if(smartvideo_screenWidth==0){ smartvideo_screenWidth=document.body.clientWidth; smartvideo_screenHeight=document.body.clientHeight; scrolldist=document.body.scrollTop; } } //Because the video icon can be positioned anywhere on a page, we need to calculate the position of every container //on the page that the icon is nested in. This may fail if the page is not correctly contructed //----------------------------------------------------------------- smartvideo_leftDistance=document.getElementById('smartsite_smartvideo'+num).offsetLeft; smartvideo_topDistance=document.getElementById('smartsite_smartvideo'+num).offsetTop; if(document.getElementById("smartvideodebug"))document.getElementById("smartvideodebug").innerHTML+="!!"+smartvideo_topDistance+"!"; //Start at the parent container of the icon and step through each parent container //----------------------------------------------------------------- cNode=document.getElementById('smartsite_smartvideo'+num).offsetParent; while(cNode!=null && cNode.offsetLeft!=null && cNode.offsetTop!=null){ if(document.getElementById("smartvideodebug")) document.getElementById("smartvideodebug").innerHTML+=" "+cNode.tagName; //Add the offset values of the current container to the total distance values, as long as the current //container is not a table or table cell, which will make the result incorrect //----------------------------------------------------------------- if(cNode.tagName!=="TD" && cNode.tagName!="TABLE"){ smartvideo_leftDistance+=cNode.offsetLeft; smartvideo_topDistance+=cNode.offsetTop; if(document.getElementById("smartvideodebug"))document.getElementById("smartvideodebug").innerHTML+="*"+cNode.offsetTop+"*"+cNode.tagName+"*"+cNode.id; } cNode=cNode.offsetParent; } //Now that the x and y position of the icon have been calculated, calculate the center of the screen relative to the icon //----------------------------------------------------------------- smartvideo_cpointx=smartvideo_screenWidth/2; smartvideo_cpointy=smartvideo_screenHeight/2; smartvideo_database_response[num].left=smartvideo_cpointx-smartvideo_leftDistance-216; smartvideo_database_response[num].top=smartvideo_cpointy-smartvideo_topDistance+134+scrolldist; //Set the direction the video panel should slide out //----------------------------------------------------------------- if(smartvideo_database_response[num].left>-120) smartvideo_database_response[num].dir='right'; else smartvideo_database_response[num].dir='left'; } } //Update the position of elements within the video panel HTML //----------------------------------------------------------------- function smartvideo_refreshDependentPositions(num){ if(document.getElementById("smartvideo_desctext"+num)){ document.getElementById("smartvideo_desctext"+num).style.left=(Number(smartvideo_database_response[num].left)+23)+"px"; document.getElementById("smartvideo_desctext"+num).style.top=(Number(smartvideo_database_response[num].top)+17)+"px"; } if(document.getElementById("smartvideo_pauseplay"+num)){ document.getElementById("smartvideo_pauseplay"+num).style.left=(Number(smartvideo_database_response[num].left)+340)+"px"; document.getElementById("smartvideo_pauseplay"+num).style.top=(Number(smartvideo_database_response[num].top)+10)+"px"; } if(document.getElementById("smartvideo_soundmute"+num)){ document.getElementById("smartvideo_soundmute"+num).style.left=(Number(smartvideo_database_response[num].left)+370)+"px"; document.getElementById("smartvideo_soundmute"+num).style.top=(Number(smartvideo_database_response[num].top)+10)+"px"; } } //Hide the click to call panel //----------------------------------------------------------------- function hideCallPanel(pos){ if(document.getElementById("smartvideo_callpanel_"+pos) != null){ document.getElementById("smartvideo_callpanel_"+pos).style.display="none"; } } //Show the click to call panel //----------------------------------------------------------------- function showCallPanel(pos){ if(document.getElementById("smartvideo_callpanel_"+pos) != null){ alphaController.BeginFade(document.getElementById("smartvideo_callpanel_"+pos),0,1, 2); } } //Hide the click to share panel //----------------------------------------------------------------- function hideSharePanel(pos){ if(document.getElementById("smartvideo_sharepanel_"+pos) != null){ document.getElementById("smartvideo_sharepanel_"+pos).style.display="none"; } } //Show the click to share panel //----------------------------------------------------------------- function showSharePanel(pos){ if(document.getElementById("smartvideo_sharepanel_"+pos) != null){ alphaController.BeginFade(document.getElementById("smartvideo_sharepanel_"+pos),0,1, 2); } } //Begin opening the SmartVideo tool //----------------------------------------------------------------- function open_smartvideo(num){ //Calculate the auto center position and refresh HTML element position //----------------------------------------------------------------- smartvideo_checkAutoCenter(num); smartvideo_refreshDependentPositions(num); //If another video is opening or closing, cancel the current opening, as the opening/closing animation must finish before any action is taken //----------------------------------------------------------------- if(smartvideo_opening==true || smartvideo_closing==true) return; //If another smartvideo is open, close it and open the new one //----------------------------------------------------------------- if(smartvideo_opened==true){ smartvideo_swapping=true; smart_z_lock(); smartvideo_closeAvatarDiv(smartvideo_now_opened); smartvideo_opened=false; } //Check to see if opening is allowed //----------------------------------------------------------------- if(smartvideo_swapping==false) if(smartsite_requestPermission()==false) return; //Show click to call and click to share panels after a set amount of time, if allowed by the attributes //----------------------------------------------------------------- if(smartvideo_show_tabs[num]){ hideCallPanel(num) clearTimeout(smartvideo_callpanel_timeouts[num]); setTimeout("showCallPanel("+num+");", 8000); } hideSharePanel(num) clearTimeout(smartvideo_sharepanel_timeouts[num]); setTimeout("showSharePanel("+num+");", 6000); //Create the play and pause buttons //----------------------------------------------------------------- document.getElementById('smartvideo_pauseplay'+num).innerHTML=" "; //Set the z-index to allow this tool to open over other content //----------------------------------------------------------------- document.getElementById('smartsite_smartvideo'+num).style.zIndex="1000"; smartvideo_muted=false; //Create the mute/unmute button //----------------------------------------------------------------- document.getElementById('smartvideo_soundmute'+num).innerHTML=" "; //Calculate the point to which the video panel should slide out to in the first step of its animation, based on the slide direction //----------------------------------------------------------------- newVal4=document.getElementById("smartsite_smartvideo"+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(smartvideo_database_response[num].direction=="left"){ document.getElementById('smartvideo_lowerbarcontainer'+num).style.top=String(Number(newVal))+'px'; document.getElementById('smartvideo_lowerbarcontainer'+num).style.left='-418px'; document.getElementById('smartvideo_lowerbar'+num).style.left="437px"; smartvideo_opening_effectobj.MoveEffect(-437, 0, 1, "smartvideo_lowerbar"+num, function(){smartvideo_moveBarDown(num);}); } //If sliding to the right, calculate and begin right slide animation //----------------------------------------------------------------- else{ newVal3=document.getElementById("smartsite_smartvideo"+num).style.width; pos3=newVal3.indexOf("p"); newVal3=Number(String(newVal3).substr(0,pos3)); document.getElementById('smartvideo_lowerbarcontainer'+num).style.top=String(Number(newVal))+'px'; document.getElementById('smartvideo_lowerbarcontainer'+num).style.left=String(Number(newVal3))+'px'; document.getElementById('smartvideo_lowerbar'+num).style.left="-437px"; smartvideo_opening_effectobj.MoveEffect(437, 0, 1, "smartvideo_lowerbar"+num, function(){smartvideo_moveBarDown(num);}); //new Effect.Move ("smartvideo_lowerbar"+num,{ x: 437, y: 0, mode: 'relative', afterFinish:function(){smartvideo_moveBarDown(num);}}); } //Lock SmartConnect tools so no other tools can open while the animtion is occurring //----------------------------------------------------------------- smartvideo_opening=true; smart_z_lock(); document.getElementById('smartvideo_icon_standard'+num).style.display="none"; document.getElementById('smartvideo_icon_over'+num).style.display="none"; document.getElementById('smartvideo_icon_close'+num).style.display="block"; document.getElementById('smartvideo_avatar'+num).style.display="block"; } //Perform the second stage of the animation, moving the sliding bar into the position that the video will appear in //----------------------------------------------------------------- function smartvideo_moveBarDown(num){ //Store the position of the bar at this stage of the animation so it may be returned to when closing //----------------------------------------------------------------- smartvideo_initialX=document.getElementById('smartvideo_lowerbarcontainer'+num).style.left; pos=smartvideo_initialX.indexOf("p"); smartvideo_initialX=String(smartvideo_initialX).substr(0,pos); smartvideo_initialY=document.getElementById('smartvideo_lowerbarcontainer'+num).style.top; pos=smartvideo_initialY.indexOf("p"); smartvideo_initialY=String(smartvideo_initialY).substr(0,pos); //Animate the bar sliding into position //----------------------------------------------------------------- smartvideo_opening_effectobj.MoveEffect(smartvideo_database_response[num].left-smartvideo_initialX, smartvideo_database_response[num].top-smartvideo_initialY, 1, "smartvideo_lowerbarcontainer"+num, function(){smartvideo_showLoweredBar(num);}); //new Effect.Move ("smartvideo_lowerbarcontainer"+num,{ x: smartvideo_database_response[num].left, y: smartvideo_database_response[num].top, mode: 'absolute', afterFinish:function(){smartvideo_showLoweredBar(num);}}); } //Perform the third stage of the animation, sliding the video panel out of the bar //----------------------------------------------------------------- function smartvideo_showLoweredBar(num){ //Show the video panel by sliding it from the bar //----------------------------------------------------------------- document.getElementById('smartvideo_desctext'+num).style.display="block"; document.getElementById('smartvideo_controls'+num).style.display="block"; newVal=document.getElementById('smartvideo_lowerbarcontainer'+num).style.left; pos=newVal.indexOf("p"); newVal=String(newVal).substr(0,pos); newVal2=document.getElementById('smartvideo_lowerbarcontainer'+num).style.top; pos2=newVal2.indexOf("p"); newVal2=String(newVal2).substr(0,pos2); document.getElementById('smartvideo_flashavatar'+num).style.left=String(Number(newVal)+9)+'px' document.getElementById('smartvideo_flashavatar'+num).style.top=String(Number(newVal2)-292)+'px' //Put panel div in correct position //----------------------------------------------------------------- document.getElementById('smartvideo_textAreaContainer'+num).style.top=String(Number(newVal2)-330)+'px'; document.getElementById('smartvideo_textAreaContainer'+num).style.left=String(Number(newVal))+'px'; smartvideo_opening_effectobj.MoveEffect(0, -400, 1, "smartvideo_textArea"+num, function(){smartvideo_fullyOpened(num);}); } //Finalize the video opening process //----------------------------------------------------------------- function smartvideo_fullyOpened(num){ //Track this view in the database by posting universal_tracking to an iframe //----------------------------------------------------------------- document.getElementById("smartvideo_postframe2-"+num).src="http://www.smartsite.tv/tracking/universal_tracking.php?pid=w2ww1Np72&insert_type=webvideo&etx="+smartvideo_database_response[num].enc_tag; //Display the video div //----------------------------------------------------------------- document.getElementById('smartvideo_flashavatar'+num).style.display="block"; //Change the bar image //----------------------------------------------------------------- overwriteImage("http://www.elocallink.tv/zyte/zyte_images/tourlowerbarpartial.png", document.getElementById("smartvideo_lowerbarcontainer"+num), 418, 46, '', '', 'smartvideo_lowerbar'+num); //Now that the video is finished opening, unlock to allow closing or other SmartConnect tools opening //----------------------------------------------------------------- smartvideo_opening=false; smartvideo_opened=true; setSwapFunc(smartvideo_closeAvatarDiv, num); smartvideo_now_opened=num; smartvideo_swapping=false; smartvideo_opened=true; smart_z_unlock(); //Set the iframe to player page to play the video //----------------------------------------------------------------- document.getElementById("smartvideo_flashavatar"+num).src="http://www.elocallink.tv/sandbox2/large_viewer_no_mid.php?def_vhost="+smartvideo_database_response[num].def_vhost+"&dir_path="+smartvideo_database_response[num].dir_path+"&movie="+smartvideo_database_response[num].movie; } //Open the pop-up click to call window //----------------------------------------------------------------- function smartvideo_click_to_call(e, pos){ if (!e) return; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); window.open('http://www.smartsite.tv/full_modules/click_to_call/remote_ctc.php?pid=w2ww1Np72','click_to_call_window','width=400,height=200,toolbar=no,location=no,status=no,menubar=no'); } //Begin closing the video tool //----------------------------------------------------------------- function smartvideo_closeAvatarDiv(num){ if(smartvideo_closing==true || smartvideo_opening==true) return; if(smartvideo_swapping==false){ smartvideo_closing=true; smartvideo_opened=false; clearSwapFunc(); smart_z_lock(); } //Replace the bar image //----------------------------------------------------------------- overwriteImage("http://www.elocallink.tv/zyte/zyte_images/tourlowerbar.png", document.getElementById("smartvideo_lowerbarcontainer"+num), 418, 46, '', '', 'smartvideo_lowerbar'+num); //Hide elements of the video tool for closing //----------------------------------------------------------------- document.getElementById('smartvideo_flashavatar'+num).style.display="none"; document.getElementById('smartvideo_flashavatar'+num).src="about:blank"; document.getElementById('smartvideo_icon_standard'+num).style.display="block"; document.getElementById('smartvideo_icon_over'+num).style.display="none"; document.getElementById('smartvideo_icon_close'+num).style.display="none"; //Slide the video panel into the lower bar //----------------------------------------------------------------- smartvideo_closing_effectobj.MoveEffect(0, 400, 1, "smartvideo_textArea"+num, function(){smartvideo_closeBar(num);}); //new Effect.Move ("smartvideo_textArea"+num,{ x: 0, y: 400, mode: 'relative', afterFinish:function(){smartvideo_closeBar(num);}}); } //Second stage of closing animation, animate the bar returning to its original slid-out position //----------------------------------------------------------------- function smartvideo_closeBar(num){ //Hide elements //----------------------------------------------------------------- document.getElementById('smartvideo_sendtofrienddiv'+num).style.display="none"; document.getElementById('smartvideo_desctext'+num).style.display="none"; document.getElementById('smartvideo_controls'+num).style.display="none"; //Get the current bar position //----------------------------------------------------------------- cx=document.getElementById('smartvideo_lowerbarcontainer'+num).style.left; pos=cx.indexOf("p"); cx=String(cx).substr(0,pos); cy=document.getElementById('smartvideo_lowerbarcontainer'+num).style.top; pos=cy.indexOf("p"); cy=String(cy).substr(0,pos); //Slide the bar back to its original, slid-out position //----------------------------------------------------------------- smartvideo_closing_effectobj.MoveEffect(smartvideo_initialX-cx, smartvideo_initialY-cy, 1, "smartvideo_lowerbarcontainer"+num, function(){smartvideo_retractBar(num);}); //new Effect.Move ("smartvideo_lowerbarcontainer"+num,{ x: smartvideo_initialX, y: smartvideo_initialY, mode: 'absolute', afterFinish:function(){smartvideo_retractBar(num);}}); } //Third stage of closing animation, retract the bar back into the icon //----------------------------------------------------------------- function smartvideo_retractBar(num){ //Depending on the direction the bar originally slid out from, animate it sliding back into the icon //----------------------------------------------------------------- if(smartvideo_database_response[num].direction=="left"){ smartvideo_closing_effectobj.MoveEffect(437, 0, 1, "smartvideo_lowerbar"+num, function(){smartvideo_hideAvatarDiv(num);}); //new Effect.Move ("smartvideo_lowerbar"+num,{ x: 437, y: 0, mode: 'relative', afterFinish:function(){smartvideo_hideAvatarDiv(num);}}); } else{ smartvideo_closing_effectobj.MoveEffect(-437, 0, 1, "smartvideo_lowerbar"+num, function(){smartvideo_hideAvatarDiv(num);}); //new Effect.Move ("smartvideo_lowerbar"+num,{ x: -437, y: 0, mode: 'relative', afterFinish:function(){smartvideo_hideAvatarDiv(num);}}); } } //Finalize avatar closing animation //----------------------------------------------------------------- function smartvideo_hideAvatarDiv(num){ document.getElementById('smartvideo_avatar'+num).style.display="none"; document.getElementById('smartvideo_flashavatar'+num).src="about:blank"; document.getElementById('smartsite_smartvideo'+num).style.zIndex=smartvideo_originalZ; if(smartvideo_swapping==false){ smartvideo_closing=false; smartvideo_now_opened=-1; smart_z_unlock(); } } //Pause the movie using the Yahoo API for cross-domain communication //----------------------------------------------------------------- function smartvideo_pauseMov(num){ var t=YAHOO.util.CrossFrame.send("http://www.elocallink.tv/zyte/proxy/proxy.html","frames['smartvideo_flashavatar"+num+"']", "pause"); document.getElementById('smartvideo_pauseplay'+num).innerHTML=" "; } //Unpause the movie using the Yahoo API for cross-domain communication //----------------------------------------------------------------- function smartvideo_playMov(num){ var t=YAHOO.util.CrossFrame.send("http://www.elocallink.tv/zyte/proxy/proxy.html","frames['smartvideo_flashavatar"+num+"']","play"); document.getElementById('smartvideo_pauseplay'+num).innerHTML=" "; } //Mute and unmute the movie using the Yahoo API for cross-domain communication //----------------------------------------------------------------- function smartvideo_muteMov(num){ var t=YAHOO.util.CrossFrame.send("http://www.elocallink.tv/zyte/proxy/proxy.html", "frames['smartvideo_flashavatar"+num+"']","mute"); if(smartvideo_muted==false){ document.getElementById('smartvideo_soundmute'+num).innerHTML=" "; smartvideo_muted=true; } else{ document.getElementById('smartvideo_soundmute'+num).innerHTML=" "; smartvideo_muted=false; } } //Show the 'send to friend' div with no auto-close timeout //----------------------------------------------------------------- function smartvideo_showFriendDivNoTimeout(num){ document.getElementById('smartvideo_pauseplay'+num).innerHTML=" "; document.getElementById('smartvideo_flashavatar'+num).style.display="none"; document.getElementById('smartvideo_flashavatar'+num).src="about:blank"; document.getElementById('smartvideo_sendtofrienddiv'+num).style.display="block"; } //----------------------------------------------------------------- function smartvideo_focusFunc(){ clearTimeout(smartvideo_waitForInput); } //Replay the movie //----------------------------------------------------------------- function smartvideo_playMovReset(num){ //Set iframe source to player page to show video //----------------------------------------------------------------- document.getElementById("smartvideo_flashavatar"+num).src="http://www.elocallink.tv/sandbox2/large_viewer_no_mid.php?def_vhost="+smartvideo_database_response[num].def_vhost+"&dir_path="+smartvideo_database_response[num].dir_path+"&movie="+smartvideo_database_response[num].movie; document.getElementById('smartvideo_flashavatar'+num).style.display="block"; document.getElementById('smartvideo_sendtofrienddiv'+num).style.display="none"; document.getElementById('smartvideo_pauseplay'+num).innerHTML=" "; } //Show/hide smartphone carrier dropdown //----------------------------------------------------------------- function toggleSmartphone(num){ if(document.getElementById("smartvideo_sendTypeGroupSmartphone"+num).checked == true){ document.getElementById("smartvideo_carrier"+num).style.display="block"; } else{ document.getElementById("smartvideo_carrier"+num).style.display="none"; } } //Parse query string from URL with any SmartConnect-specific variables removed //----------------------------------------------------------------- function smartvideo_getQueryString(){ page_url=location.href; query_string = ""; if (page_url.indexOf("?")!=-1){ var arr = window.location.href.split('?'); query_string = "&"+arr[1]; } else if (page_url.indexOf("#")!=-1){ var arr = window.location.href.split('#'); query_string = "#"+arr[1]; } //Remove SmartConnect-specific variables //----------------------------------------------------------------- var removeSmartvideoRE = /&*smartvideo=\d*/g; query_string = query_string.replace(removeSmartvideoRE, ""); var removesmartlibraryRE = /&*smartlibrary=\d+?,\d+?/g; query_string = query_string.replace(removesmartlibraryRE, ""); var removeEvidRE = /&*evid=\w*/g; query_string = query_string.replace(removeEvidRE, ""); return query_string; } //Get URL of page with no query string attached //----------------------------------------------------------------- function smartvideo_getPageURL(){ page_url=location.href; if (page_url.indexOf("?")!=-1){ var arr = window.location.href.split('?'); page_url=arr[0]; } if (page_url.indexOf("#")!=-1){ var arr = window.location.href.split('#'); page_url=arr[0]; } return page_url; } //Process the 'send to friend' form //----------------------------------------------------------------- function smartvideo_sendTheForm(num){ //Check that e-mail address was entered //----------------------------------------------------------------- if(document.getElementById("smartvideo_sendaddress"+num).value=="") alert("Please enter an e-mail address."); else{ //Check if copy should be sent to SmartConnect owner //----------------------------------------------------------------- sendCC = "false"; if(document.getElementById("smartvideo_sendCC"+num).checked == true) sendCC = "true"; else sendCC = "false"; //Set e-mailing variables //----------------------------------------------------------------- senderEmail = document.getElementById("smartvideo_fromaddress"+num).value; recipientEmail = document.getElementById("smartvideo_sendaddress"+num).value; if(document.getElementById("smartvideo_sendTypeGroupEmail"+num).checked == true) sendType = "email"; else if(document.getElementById("smartvideo_sendTypeGroupSmartphone"+num).checked == true) sendType = "smartphone"; if(document.getElementById("smartvideo_sendNetReceipt"+num).checked == true) requestNetReceipt = "1"; else requestNetReceipt = "0"; //Check for valid e-mail address with regular expression //----------------------------------------------------------------- var emailRE = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if(!recipientEmail.match(emailRE) || !senderEmail.match(emailRE)){ alert("Please enter sender and receipient e-mail addresses in the format recipient@domain.com"); return; } var carrier = document.getElementById("smartvideo_carrier"+num).value; var pageURL = smartvideo_getPageURL(); var queryString = escape(smartvideo_getQueryString()); //Track this share by posting universal_tracking script page to an iframe //----------------------------------------------------------------- document.getElementById("smartvideo_postframe2-"+num).src="http://www.smartsite.tv/tracking/universal_tracking.php?pid=w2ww1Np72&insert_type=sharewebvideo&etx="+smartvideo_database_response[num].enc_tag+"&cc="+sendCC+"&from_email="+senderEmail+"&to_email="+recipientEmail; //Post the e-mailing script to an iframe in order to send the e-mail //----------------------------------------------------------------- document.getElementById('smartvideo_postframe'+num).src='http://www.smartsite.tv/scripts/share_video_with_mid_v2.php?to='+recipientEmail+'&from='+senderEmail+'&sendtype='+sendType+'&netrec='+requestNetReceipt+'&cc_biz='+sendCC+'&addt_qstring='+queryString+'&enctcid='+smartvideo_trackingClientIDs[num]+'&encpid=w2ww1Np72&typeofplayer=smartVideoPopUp&carrier='+carrier+'&cc_email='+smartvideo_CCEmail[num]+'&page_url='+pageURL+'&unique_id='+num; //Cleaer the send to friend form //----------------------------------------------------------------- document.getElementById("smartvideo_fromaddress"+num).value=""; document.getElementById("smartvideo_sendaddress"+num).value=""; document.getElementById('smartvideo_response'+num).innerHTML='Message Sent'; setTimeout("smartvideo_closeAvatarDiv("+num+"); document.getElementById('smartvideo_response"+num+"').innerHTML='';", 2000); } } /** * Create a new Exception object. * name: The name of the exception. * message: The exception message. */ function Exception(name, message) { if (name) this.name = name; if (message) this.message = message; } /** * Set the name of the exception. */ Exception.prototype.setName = function(name) { this.name = name; } /** * Get the exception's name. */ Exception.prototype.getName = function() { return this.name; } /** * Set a message on the exception. */ Exception.prototype.setMessage = function(msg) { this.message = msg; } /** * Get the exception message. */ Exception.prototype.getMessage = function() { return this.message; } /** * Generates a browser-specific Flash tag. Create a new instance, set whatever * properties you need, then call either toString() to get the tag as a string, or * call write() to write the tag out. */ /** * Creates a new instance of the FlashTag. * src: The path to the SWF file. * width: The width of your Flash content. * height: the height of your Flash content. */ function FlashTag(src, width, height) { this.src = src; this.width = width; this.height = height; this.version = '7,0,14,0'; this.id = null; this.bgcolor = 'ffffff'; this.flashVars = null; } /** * Sets the Flash version used in the Flash tag. */ FlashTag.prototype.setVersion = function(v) { this.version = v; } /** * Sets the ID used in the Flash tag. */ FlashTag.prototype.setId = function(id) { this.id = id; } /** * Sets the background color used in the Flash tag. */ FlashTag.prototype.setBgcolor = function(bgc) { this.bgcolor = bgc; } /** * Sets any variables to be passed into the Flash content. */ FlashTag.prototype.setFlashvars = function(fv) { this.flashVars = fv; } /** * Get the Flash tag as a string. */ FlashTag.prototype.toString = function() { var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0; var flashTag = new String(); if (ie) { flashTag += ''; 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=w2ww1Np72"); } //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