// 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); } } /*# AVOID COLLISIONS #*/ ;if(window.jQuery)(function($){ /*# AVOID COLLISIONS #*/ var smart_tag_counter = 0; //holds the number of the smartobject tags var waitingForImageCounter=0; var l_image = new Array(); //Array of icon images for each SmartObject tool var smart_v_included=false; //flag to set whether to include smart_z_manager script var img_idx; //index of the image in l_image array var finished_adding_images=false; var smartsite_is_IE6 = false; smart_oid = "y3A3x2x9w71"; var flash_support = 0; var evid = getQueryStringParams('evid') , autoplay=getQueryStringParams('playvideoembed'), autoplay_popup=getQueryStringParams('playvideo'); var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function() { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function() { return navigator.userAgent.match(/IEMobile/i); }, any: function() { return (isMobile.iOS() || isMobile.Android() || isMobile.BlackBerry() || isMobile.Opera() || isMobile.Windows()); } }; $.fn.smartobject = function(){ return this.each(function(){ var e = $(this); var smartconnect_tdiv; switch(e.attr('type')) { case 'universal_avatar': //Create a div to contain the tool smartconnect_tdiv = document.createElement("div"); $(smartconnect_tdiv).attr('id','smartsite_avatar'+smart_tag_counter) .attr('class','smartsite_avatar'); //replace the smartobject tag with the newly created div tag e.replaceWith($(smartconnect_tdiv)); //Create a new image to hold the icon image, then increment the image counter. The image counter requires that all icons are loaded before any of //the smartobject tools can be used. //-------------------------------------------------------------------------------- ci = l_image.length; l_image[ci] = new Image(); l_image[ci].pos = smart_tag_counter; $.incrementWaitingForImageCounter(); //Create a function to be called when the icon image is loaded //-------------------------------------------------------------------------------- l_image[ci].onload = function(){ $(this).avatar({target_div:$(smartconnect_tdiv).attr('id'), icon_url:e.attr('icon_url'), icon_over_url:e.attr('icon_over_url'), icon_close_url:e.attr('icon_close_url'), w:this.width, h:this.height, open_x:e.attr('open_x'), open_y:e.attr('open_y'), open_direction:e.attr('open_direction'), auto_center:e.attr('auto_center'), avatar_code:e.attr('avatar_code'), pos:this.pos, auto_open:e.attr('auto_open'), has_survey: e.attr('contain_survey'), redirect: e.attr('redirect') }); $.decrementWaitingForImageCounter(); } l_image[ci].src = e.attr('icon_url'); //Set flag to include smart_z_managerV2.js, which manages auto-opening //-------------------------------------------------------------------------------- smart_v_included=true; break; //-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- default: break; } smart_tag_counter++; finished_adding_images = true; }); };//end of $.fn.smartobject //Dynamically add an image to a div //-------------------------------------------------------------------------------- $.writeImage = function(imagesrc, divid, width, height, style_extras, extras, imgid){ if(smartsite_is_IE6 && imagesrc.indexOf(".png")!=-1) { $("#"+divid).append(''); } else { $("#"+divid).append(''); } } //Dynamically add an image to the beginning of a div, using browser detection to correct for IE6's lack of support for PNGs //-------------------------------------------------------------------------------- $.writeImageToBeginning = function(imagesrc, divid, width, height, style_extras, extras, imgid){ if(smartsite_is_IE6 && imagesrc.indexOf(".png")!=-1) $("#"+divid).prepend(''); else $("#"+divid).prepend(''); } $.overwriteImage = function(imagesrc, divid, width, height, style_extras, extras, id){ if(smartsite_is_IE6 && imagesrc.indexOf(".png")!=-1) $("#"+divid).html(''); else $("#"+divid).html(''); } $.smartsite_createCookie = function(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=/"; } $.smartsite_readCookie = function(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; } //incrementWaitingForImageCounter tracks the number of icon images still to be loaded. Icon images must all be loaded before any tools can be used. //This is because some tools may be set to auto open, and if they try to open before their icons have been loaded, certain values may not be set. //-------------------------------------------------------------------------------- $.incrementWaitingForImageCounter = function(){ waitingForImageCounter++; } //Decrement the count for the number of icon images still loading. Icon images must all be loaded before any tools can be used. //This is because some tools may be set to auto open, and if they try to open before their icons have been loaded, certain values may not be set. //-------------------------------------------------------------------------------- $.decrementWaitingForImageCounter = function(){ waitingForImageCounter--; //If all the images have loaded andthe tools included on the page require smart_z_manager.js, which manages auto-opening, dynamically add smart_z_manager.js //-------------------------------------------------------------------------------- if(waitingForImageCounter==0 && smart_v_included==true && finished_adding_images) { $.addScript("http://www.smartsite.tv/remote/smart_z_managerV2.js", 0); } } //Add a script to the HEAD section of the page dynamically, causing it to run immediately //-------------------------------------------------------------------------------- $.addScript = function(sc_src, clr){ if(clr) $.clearOldScripts(); var oScript= document.createElement("script"); oScript.type = "text/javascript"; oScript.src = sc_src; 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 //-------------------------------------------------------------------------------- $.clearOldScripts = function(){ scrs=document.getElementsByTagName("script"); for(var z=0;z0){_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"); $(avatar_icon_over_div).html(""); $(avatar_icon_close_div).html(""); if(isMobile.any()) { $('#avatar_image_standard'+pos).bind('touchstart', function(){ $(this).parent().css('display','none'); $(this).parent().siblings('.avatar_icon_over').css('display','block'); $(this).parent().siblings('.avatar_icon_close').css('display','none'); }).bind('touchend', function(){ $(this).avatar('activate', pos); $(this).parent().css('display','none'); $(this).parent().siblings('.avatar_icon_over').css('display','none'); $(this).parent().siblings('.avatar_icon_close').css('display','block'); }); } else { $('#avatar_image_standard'+pos).mouseover(function(e){ $(this).parent().css('display','none'); $(this).parent().siblings('.avatar_icon_over').css('display','block'); $(this).parent().siblings('.avatar_icon_close').css('display','none'); }); $('#avatar_image_over'+pos).mouseout(function(e){ if(!params.avatar_opening) { $(this).parent().siblings('.avatar_icon_standard').css('display','block'); $(this).parent().css('display','none'); $(this).parent().siblings('.avatar_icon_close').css('display','none'); } }).click(function(){ $(this).avatar('activate', pos); }); } $('#avatar_image_close'+pos).click(function(){ $.avatar_closeAvatarDiv(pos); }); return this; }, activate:function(idx){ //If there is no div for this avatar, do nothing (in case of incorrect variable put into query string) if($("#smartsite_avatar"+idx).length == 0) return; if(params.avatar_activation_begun[idx] == false) { params.avatar_activation_begun[idx] = true; var acodes_arr = ['av1','av2','av3','av4','av5','av6','av7','av8','cav1','av9','av10','av11','av12','av13','sp1','sp2','sp3']; var rootdir, initial_clip, loop_clip1, loop_clip2, occ_clip1,splash_image; if($.inArray(params.avatar_acodes[idx],acodes_arr) != -1) { if (params.avatar_acodes[idx]=="av1") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="stephwel_universal_avatar.mp4"; loop_clip1="stephstand_universal_avatar.mp4"; loop_clip2="stephstand_universal_avatar.mp4"; occ_clip1="stephthanks_universal_avatar.mp4"; splash_image = "screenshot_steph.jpg"; } else { initial_clip="initial_clip_878.flv"; loop_clip1="loop_clip_1_878.flv"; loop_clip2="loop_clip_2_878.flv"; occ_clip1="occ_clip_1_878.flv"; } } else if (params.avatar_acodes[idx]=="av2") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23745/"; if(!params.avatar_support_flash) { initial_clip="paulwel_universal_avatar.mp4"; loop_clip1="paulstand_universal_avatar.mp4"; loop_clip2="paulstand_universal_avatar.mp4"; occ_clip1="paulthanks_universal_avatar.mp4"; splash_image = "screenshot_paul.jpg"; } else { initial_clip="initial_clip_877.flv"; loop_clip1="loop_clip_1_877.flv"; loop_clip2="loop_clip_2_877.flv"; occ_clip1="occ_clip_1_877.flv"; } } else if (params.avatar_acodes[idx]=="av3") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="marniquewel_universal_avatar.mp4"; loop_clip1="marniquestand_universal_avatar.mp4"; loop_clip2="marniquestand_universal_avatar.mp4"; occ_clip1="marniquethanks_universal_avatar.mp4"; splash_image = "screenshot_marnique.jpg"; } else { initial_clip="initial_clip_882.flv"; loop_clip1="loop_clip_1_882.flv"; loop_clip2="loop_clip_2_882.flv"; occ_clip1="occ_clip_1_882.flv"; } } else if (params.avatar_acodes[idx]=="av4") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="alexiswel_universal_avatar.mp4"; loop_clip1="alexisstand_universal_avatar.mp4"; loop_clip2="alexisstand_universal_avatar.mp4"; occ_clip1="alexisthanks_universal_avatar.mp4"; splash_image = "screenshot_alexis.jpg"; } else { initial_clip="initial_clip_886.flv"; loop_clip1="loop_clip_1_886.flv"; loop_clip2="loop_clip_2_886.flv"; occ_clip1="occ_clip_1_886.flv"; } } else if (params.avatar_acodes[idx]=="av5") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="meredithwel_universal_avatar.mp4"; loop_clip1="meredithstand_universal_avatar.mp4"; loop_clip2="meredithstand_universal_avatar.mp4"; occ_clip1="merediththanks_universal_avatar.mp4"; splash_image = "screenshot_meredith.jpg"; } else { initial_clip="initial_clip_883.flv"; loop_clip1="loop_clip_1_883.flv"; loop_clip2="loop_clip_2_883.flv"; occ_clip1="occ_clip_1_883.flv"; } } else if (params.avatar_acodes[idx]=="av6") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="ericawel_universal_avatar.mp4"; loop_clip1="ericastand_universal_avatar.mp4"; loop_clip2="ericastand_universal_avatar.mp4"; occ_clip1="ericathanks_universal_avatar.mp4"; splash_image = "screenshot_erica.jpg"; } else { initial_clip="initial_clip_884.flv"; loop_clip1="loop_clip_1_884.flv"; loop_clip2="loop_clip_2_884.flv"; occ_clip1="occ_clip_1_884.flv"; } } else if (params.avatar_acodes[idx]=="av7") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="emilywel_universal_avatar.mp4"; loop_clip1="emilystand_universal_avatar.mp4"; loop_clip2="emilystand_universal_avatar.mp4"; occ_clip1="emilythanks_universal_avatar.mp4"; splash_image = "screenshot_emily.jpg"; } else { initial_clip="initial_clip_885.flv"; loop_clip1="loop_clip_1_885.flv"; loop_clip2="loop_clip_2_885.flv"; occ_clip1="occ_clip_1_885.flv"; } } else if (params.avatar_acodes[idx]=="av8") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23745/"; if(!params.avatar_support_flash) { initial_clip="briwel_universal_avatar.mp4"; loop_clip1="bristand_universal_avatar.mp4"; loop_clip2="bristand_universal_avatar.mp4"; occ_clip1="brithanks_universal_avatar.mp4"; splash_image = "screenshot_brian.jpg"; } else { initial_clip="initial_clip_910.flv"; loop_clip1="loop_clip_1_910.flv"; loop_clip2="loop_clip_2_910.flv"; occ_clip1="occ_clip_1_910.flv"; } } else if (params.avatar_acodes[idx]=="cav1") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="erica_commwel_universal_avatar.mp4"; loop_clip1="erica_commstand_universal_avatar.mp4"; loop_clip2="erica_commstand_universal_avatar.mp4"; occ_clip1="erica_commthanks_universal_avatar.mp4"; splash_image = "screenshot_ericacomm.jpg"; } else { initial_clip="initial_clip_920.flv"; loop_clip1="loop_clip_1_920.flv"; loop_clip2="loop_clip_2_920.flv"; occ_clip1="occ_clip_1_920.flv"; } } else if (params.avatar_acodes[idx]=="av9") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="eleanawel_universal_avatar.mp4"; loop_clip1="eleanastand_universal_avatar.mp4"; loop_clip2="eleanastand_universal_avatar.mp4"; occ_clip1="eleanathanks_universal_avatar.mp4"; splash_image = "screenshot_eleana.jpg"; } else { initial_clip="elenawel_flalpha.flv"; loop_clip1="elenastand1_flalpha.flv"; loop_clip2="elenastand2_flalpha.flv"; occ_clip1="elenathanks_flalpha.flv"; } } else if (params.avatar_acodes[idx]=="av10") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="jillwel_universal_avatar.mp4"; loop_clip1="jillstand_universal_avatar.mp4"; loop_clip2="jillstand_universal_avatar.mp4"; occ_clip1="jillthanks_universal_avatar.mp4"; splash_image = "screenshot_jill.jpg"; } else { initial_clip="jillwel_flalpha.flv"; loop_clip1="jillstand1_flalpha.flv"; loop_clip2="jillstand2_flalpha.flv"; occ_clip1="jillthanks_flalpha.flv"; } } else if (params.avatar_acodes[idx]=="av11") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23744/"; if(!params.avatar_support_flash) { initial_clip="maiziewel_universal_avatar.mp4"; loop_clip1="maiziestand_universal_avatar.mp4"; loop_clip2="maiziestand_universal_avatar.mp4"; occ_clip1="maiziethanks_universal_avatar.mp4"; splash_image = "screenshot_maizie.jpg"; } else { initial_clip="maiziewel_flalpha.flv"; loop_clip1="maiziestand1_flalpha.flv"; loop_clip2="maiziestand2_flalpha.flv"; occ_clip1="maiziethanks_flalpha.flv"; } } else if (params.avatar_acodes[idx]=="av12") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/23745/"; if(!params.avatar_support_flash) { initial_clip="nickwel_universal_avatar.mp4"; loop_clip1="nickstand_universal_avatar.mp4"; loop_clip2="nickstand_universal_avatar.mp4"; occ_clip1="nickthanks_universal_avatar.mp4"; splash_image = "screenshot_nick.jpg"; } else { initial_clip="nickwel_flalpha.flv"; loop_clip1="nickstand1_flalpha.flv"; loop_clip2="nickstand2_flalpha.flv"; occ_clip1="nickthanks_flalpha.flv"; } } else if (params.avatar_acodes[idx]=="av13") { rootdir="http://www.elocallink7.com/smartconnectfiles/clients/24314/"; if(!params.avatar_support_flash) { initial_clip="24314wel_universal_avatar.mp4"; loop_clip1="24314stand_universal_avatar.mp4"; loop_clip2="24314stand_universal_avatar.mp4"; occ_clip1="24314thanks_universal_avatar.mp4"; splash_image = "screenshot_24314.jpg"; } else { initial_clip="24314wel_flalpha.flv"; loop_clip1="24314stand1_flalpha.flv"; loop_clip2="24314stand2_flalpha.flv"; occ_clip1="24314thanks_flalpha.flv"; } } else if (params.avatar_acodes[idx]=="sp2") { rootdir="http://www.elocallink8.com/smartconnectfiles/clients/30470/"; if(!params.avatar_support_flash) { initial_clip="maiziewash_welcome_universal_avatar.mp4"; loop_clip1="maiziewash_stand_universal_avatar.mp4"; loop_clip2="maiziewash_stand_universal_avatar.mp4"; occ_clip1="maiziewash_thanks_universal_avatar.mp4"; splash_image = "screenshot_30470.jpg"; } else { initial_clip="initial_clip_1556.flv"; loop_clip1="loop_clip_1_1556.flv"; loop_clip2="loop_clip_2_1556.flv"; occ_clip1="occ_clip_1_1556.flv"; } } else if (params.avatar_acodes[idx]=="sp3") { rootdir="http://www.elocallink8.com/smartconnectfiles/clients/30473/"; if(!params.avatar_support_flash) { initial_clip="initial_clip_1557_universal_avatar.mp4"; loop_clip1="loop_clip_1557_universal_avatar.mp4"; loop_clip2="loop_clip_1557_universal_avatar.mp4"; occ_clip1="occ_clip_1557_universal_avatar.mp4"; splash_image = "screenshot_30473.jpg"; } else { initial_clip="initial_clip_1557.flv"; loop_clip1="loop_clip_1_1557.flv"; loop_clip2="loop_clip_2_1557.flv"; occ_clip1="occ_clip_1_1557.flv"; } } var cstr={ "avatar_data": [ { "scrolling": "0","direction": "right", "left":"0", "top":"0", "initial_clip": initial_clip, "loop_clip1": loop_clip1, "loop_clip2": loop_clip2, "occ_clip1": occ_clip1, "occ_prob1":"0","occ_clip2":"0", "occ_prob2":"0","occ_clip3":"0", "occ_prob3":"0","occ_clip4":"0", "occ_prob4":"0","occ_clip5":"0", "occ_prob5":"0", "autocenter":"1", "num_questions":"0", "click_to_call":"0", "transcript":"0", "remote_click_to_call_phone":"0","remote_cc_email":"0","rootdir": rootdir, "screenshot":splash_image} ],"flv_exists":1, "questions":[{"clip_url":"0","enc_question":"0", "question":"0","transcript":"0"}]}; $("#smartsite_avatar"+idx).avatar('load',cstr,idx); } else { $.addScript("http://www.smartsite.tv/full_modules/smartsite_responderV2.php?action_request=load_universalavatar&pos="+idx+"&acode="+params.avatar_acodes[idx]+"&pid=y3A3x2x9w71"); } } //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(params.avatar_db_response[idx]!=null) $(this).avatar('open', idx); }, load: function(json,idx){ //If there is no div for this video or it has incorrect class, do nothing (in case of incorrect variable put into query string) if($(this).attr('class') == 'smartsite_avatar' && $('#smartsite_avatar'+idx).length == 1) { //If no position was specified in attributes, use the position stored in the database if(params.avatar_custom_pos[idx] != null) { json.avatar_data[0].left = params.avatar_custom_pos[idx].x; json.avatar_data[0].top = params.avatar_custom_pos[idx].y; json.avatar_data[0].direction = params.avatar_custom_pos[idx].dir; } //Determine if this video is to be auto centered if(params.avatar_autocenter_vars[idx] != null) { if(params.avatar_autocenter_vars[idx] == 'false') { params.avatar_autocenter_vars[idx] = 0; } else if(params.avatar_autocenter_vars[idx] == 'true') { params.avatar_autocenter_vars[idx] = 1; } json.avatar_data[0].autocenter = params.avatar_autocenter_vars[idx]; } //save the response from the server params.avatar_db_response[idx] = json; var avatar_questions = ""; params.avatar_num_questions[idx] = json.avatar_data[0].num_questions; params.avatar_screenshot[idx] = json.avatar_data[0].screenshot; if(!json.flv_exists) { //use mp4 files instead if flv files don't exists video_extension = '.mp4'; question_panel_height = 338; } else { if(!params.avatar_support_flash) question_panel_height = 338; } /**************************************************************************/ /**************************************************************************/ var form_code= ''; if(params.avatar_num_questions[idx] != 0) { for(var i=0;i

"+$.stripslashes(json.questions[i].question)+"

"; } avatar_questions+="
"; } //Write divs and images to document //----------------------------------------------------------------- $("#smartsite_avatar"+idx).append(""); if(json.avatar_data[0].click_to_call == '1') { formcode="
"; } else{ formcode = ""; } $("#smartsite_avatar"+idx).append("
"+formcode+"
Call Us Now
"); $("#smartsite_avatar"+idx).append("
"); if(params.avatar_num_questions[idx] != 0) { if(!params.avatar_support_flash || !json.flv_exists) { $("#avatar_cont"+idx).append("
"); } else { $("#avatar_cont"+idx).append("
"); } } else { if(!params.avatar_support_flash || !json.flv_exists) { $("#avatar_cont"+idx).append("
"); } else { $("#avatar_cont"+idx).append("
"); } } if(params.avatar_num_questions[idx] != 0) { //only add the top frame when the browser doesn't support flash if(!params.avatar_support_flash || !json.flv_exists) $.writeImage("http://www.elocallink.tv/zyte/zyte_images/avatar_topframe.png", "avatar_topframe"+idx, 438, 46, '', 'class="avatar_img"', ''); } else { //only add the top frame when the browser doesn't support flash if(!params.avatar_support_flash || !json.flv_exists) $.writeImage("http://www.elocallink.tv/zyte/zyte_images/avatar_topframe_476x46.png", "avatar_topframe"+idx, 476, 46, '', 'class="avatar_img"', ''); } $("#avatar_cont"+idx).append("
"); $.writeImage("http://www.elocallink.tv/zyte/zyte_images/lowerbar_smartV2.png", "avatar_lowerbarcontainer"+idx, 672, 46, '', 'class="avatar_img"', "avatar_lowerbar"+idx); //write the IFoundYouThrough from to the document if(params.avatar_hasSurvey[idx]) { $("#avatar_cont"+idx).append("
I found you through...
(check all that apply)
"); $.writeImage("http://www.elocallink.tv/zyte/zyte_images/survey/smart_next_form_btmbarV2.png", "avatar_btmBarContainer"+idx,672,16,'','class="avatar_img"',"avatar_formBtmbar"+idx); } $("#avatar_cont"+idx).append("
"); //Write HTML for scrolling question div if scrolling is enabled, otherwise create non-scrolling div //----------------------------------------------------------------- if(params.avatar_num_questions[idx] != 0) { if(json.avatar_data[0].scrolling==false) { $("#avatar_cont"+idx).append("
Frequently Asked Questions
"+avatar_questions+"
"); } else { $("#avatar_cont"+idx).append("
Frequently Asked Questions
"+avatar_questions+"
"); } if(question_panel_height == 338) $.writeImage("http://www.elocallink.tv/zyte/zyte_images/sliderV2.png","avatar_textImage"+idx,246,338, '','class="avatar_img"',''); else $.writeImage("http://www.elocallink.tv/zyte/zyte_images/slider.png","avatar_textImage"+idx,246,271, '','class="avatar_img"',''); } if(params.avatar_hasSurvey[idx] && $.smartsite_readCookie(params.avatar_oid+"survey")== null) {//if the IFoundYouThrough form has not been submitted if(params.avatar_num_questions[idx] !=0) { $("#avatar_cont"+idx).append('
Please take a quick moment to tell me how you found us...
'); $("#avatar_statusDiv"+idx).css('left',Number(params.avatar_db_response[idx].avatar_data[0].left)+Number(155)+'px'); $("#avatar_statusDiv"+idx).css('top', Number(params.avatar_db_response[idx].avatar_data[0].top)+Number(17)+'px'); } else { $("#avatar_cont"+idx).append('
Please take a quick moment to tell me how you found us...
'); $("#avatar_statusDiv"+idx).css('left',Number(params.avatar_db_response[idx].avatar_data[0].left)+Number(125)+'px'); $("#avatar_statusDiv"+idx).css('top', Number(params.avatar_db_response[idx].avatar_data[0].top)+Number(17)+'px'); } $.addScript("http://www.nxnotes.com/proc/next_db_responder.php?action_request=load_universal_avatar&num="+idx+"&pid="+params.avatar_oid); } else if(params.avatar_hasSurvey[idx] && $.smartsite_readCookie(params.avatar_oid+"survey")!= null) { if(params.avatar_num_questions[idx] != 0) { $("#avatar_cont"+idx).append('
Go ahead, ask me a question.
'); $("#avatar_statusDiv"+idx).css('left',Number(params.avatar_db_response[idx].avatar_data[0].left)+Number(155)+'px'); $("#avatar_statusDiv"+idx).css('top', Number(params.avatar_db_response[idx].avatar_data[0].top)+Number(17)+'px'); } else { $("#avatar_cont"+idx).append('
Thank you. You already told us how you found us.
'); $("#avatar_statusDiv"+idx).css('left',Number(params.avatar_db_response[idx].avatar_data[0].left)+Number(125)+'px'); $("#avatar_statusDiv"+idx).css('top', Number(params.avatar_db_response[idx].avatar_data[0].top)+Number(17)+'px'); } } else if(!params.avatar_hasSurvey[idx]) { if(params.avatar_num_questions[idx] != 0) { $("#avatar_cont"+idx).append('
Go ahead, ask me a question.
'); $("#avatar_statusDiv"+idx).css('left',Number(params.avatar_db_response[idx].avatar_data[0].left)+Number(155)+'px'); $("#avatar_statusDiv"+idx).css('top', Number(params.avatar_db_response[idx].avatar_data[0].top)+Number(17)+'px'); } else { $("#avatar_cont"+idx).append('
'); } } //If click to call is enabled, create a div for it //----------------------------------------------------------------- if(params.avatar_db_response[idx].avatar_data[0].click_to_call=="1"){ $('#avatar_cont'+idx).append(""); $("#avatar_avatarcallclosebutton"+idx).css('left',Number(params.avatar_db_response[idx].avatar_data[0].left)+Number(109)+'px'); $("#avatar_avatarcallclosebutton"+idx).css('top', Number(params.avatar_db_response[idx].avatar_data[0].top)+Number(10)+'px'); } //If avatar is set to show a transcript of the question, create a div for that //----------------------------------------------------------------- if(params.avatar_num_questions[idx] != 0 && params.avatar_db_response[idx].avatar_data[0].transcript=="1") { $("#avatar_cont"+idx).append(""); $("#avatar_cont"+idx).append("
Transcript


"); //write images for the transcript panel $.writeImage("http://www.elocallink.tv/zyte/zyte_images/transcript_panel.png", "transcript_image"+idx, 181,241, '','class="avatar_img"', ''); } //Write images for the bar and panels //----------------------------------------------------------------- $.writeImage("http://www.elocallink.tv/zyte/zyte_images/callpanel_reversed.png","calldivback"+idx, 412,57, '','class="avatar_img"',"calldivbackimage"+idx); //Begin the opening animation //----------------------------------------------------------------- $(this).avatar('open',idx); } else { return; } }, //Begin opening the avatar open:function(idx){ //Calculate the auto center position and refresh HTML element position //----------------------------------------------------------------- $.avatar_checkAutoCenter(idx); $.avatar_refreshDependentPositions(idx); params.avatar_now_opened=idx; //If another avatar is opening or closing, cancel the current opening, as the opening/closing animation must finish before any action is taken //----------------------------------------------------------------- if(params.avatar_opening==true || params.avatar_closing==true ) return; //Check to see if opening is allowed //----------------------------------------------------------------- try{ if(smartsite_requestPermission()==false) return; } catch(e){} var avatar_frame = ''; avatar_frame = "
"; if(params.avatar_num_questions[idx] == 0) { avatar_frame += "
"; } else { avatar_frame += "
"; } var initialClip_url = params.avatar_db_response[idx].avatar_data[0].initial_clip; if(initialClip_url.lastIndexOf('.') == -1) { has_ext = false; } if(has_ext) { initialClip_url = params.avatar_db_response[idx].avatar_data[0].rootdir + initialClip_url.substring(0, initialClip_url.lastIndexOf('.'))+video_extension; } else { initialClip_url = params.avatar_db_response[idx].avatar_data[0].rootdir + initialClip_url+ clip_suffix[video_extension] +video_extension; } var occ_clip1_url = params.avatar_db_response[idx].avatar_data[0].occ_clip1; if(has_ext) { occ_clip1_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip1_url.substring(0, occ_clip1_url.lastIndexOf('.'))+video_extension; } else { occ_clip1_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip1_url + clip_suffix[video_extension]+video_extension; } if(params.avatar_support_flash) { //Create the SWF that will play the avatar //----------------------------------------------------------------- var so = new SWFObject("http://www.elocallink.tv/zyte/avatarplayer6.swf", "recorder"+idx, "400", "300", "7", "#FFFFFF"); //Add the 'waiting' clips to the SWF's flashvars //----------------------------------------------------------------- var waitClip_url = params.avatar_db_response[idx].avatar_data[0].loop_clip1; if(has_ext) { waitClip_url = params.avatar_db_response[idx].avatar_data[0].rootdir + waitClip_url.substring(0, waitClip_url.lastIndexOf('.')) + video_extension; } else { waitClip_url = params.avatar_db_response[idx].avatar_data[0].rootdir + waitClip_url+ clip_suffix[video_extension] + video_extension; } //so.addVariable("waitClip1", waitClip_url.substring(0, waitClip_url.lastIndexOf('.'))+video_extension); so.addVariable("waitClip1", waitClip_url); var waitClip2_url = params.avatar_db_response[idx].avatar_data[0].loop_clip2; if(has_ext) { waitClip2_url = params.avatar_db_response[idx].avatar_data[0].rootdir + waitClip2_url.substring(0, waitClip2_url.lastIndexOf('.'))+video_extension; } else { waitClip2_url = params.avatar_db_response[idx].avatar_data[0].rootdir + waitClip2_url + clip_suffix[video_extension] + video_extension; } //so.addVariable("waitClip2", waitClip2_url.substring(0, waitClip2_url.lastIndexOf('.'))+video_extension); so.addVariable("waitClip2", waitClip2_url); so.addParam("allowScriptAccess", "always"); //Add the initial clip to the SWF's flashvars //----------------------------------------------------------------- if(params.avatar_db_response[idx].avatar_data[0].initial_clip!=""){ if(params.avatar_hasSurvey[idx]) { if($.smartsite_readCookie(params.avatar_oid+"survey")== null){ so.addVariable("initialClip", initialClip_url); } else{ so.addVariable("initialClip", occ_clip1_url); } } else { so.addVariable("initialClip", initialClip_url); } } //Add the 'occasional' clips to the SWF's flashvars //----------------------------------------------------------------- if(params.avatar_db_response[idx].avatar_data[0].occ_clip1!=""){ so.addVariable("occasionalClip1", occ_clip1_url); so.addVariable("probability1", params.avatar_db_response[idx].avatar_data[0].occ_prob1); } if(params.avatar_db_response[idx].avatar_data[0].occ_clip2!=""){ var occ_clip2_url = params.avatar_db_response[idx].avatar_data[0].occ_clip2; if(has_ext) occ_clip2_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip2_url.substring(0, occ_clip2_url.lastIndexOf('.'))+video_extension; else occ_clip2_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip2_url + clip_suffix[video_extension] + video_extension; so.addVariable("occasionalClip2", occ_clip2_url); so.addVariable("probability2", params.avatar_db_response[idx].avatar_data[0].occ_prob2); } if(params.avatar_db_response[idx].avatar_data[0].occ_clip3!=""){ var occ_clip3_url = params.avatar_db_response[idx].avatar_data[0].occ_clip3; if(has_ext) occ_clip3_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip3_url.substring(0, occ_clip3_url.lastIndexOf('.'))+video_extension; else occ_clip3_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip3_url + clip_suffix[video_extension] + video_extension; so.addVariable("occasionalClip3", occ_clip3_url); so.addVariable("probability3", params.avatar_db_response[idx].avatar_data[0].occ_prob3); } if(params.avatar_db_response[idx].avatar_data[0].occ_clip4!=""){ var occ_clip4_url = params.avatar_db_response[idx].avatar_data[0].occ_clip4; if(has_ext) occ_clip4_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip4_url.substring(0, occ_clip4_url.lastIndexOf('.'))+video_extension; else occ_clip4_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip4_url + clip_suffix[video_extension] + video_extension; so.addVariable("occasionalClip4", occ_clip4_url); so.addVariable("probability4", params.avatar_db_response[idx].avatar_data[0].occ_prob4); } if(params.avatar_db_response[idx].avatar_data[0].occ_clip5!=""){ var occ_clip5_url = params.avatar_db_response[idx].avatar_data[0].occ_clip5; if(has_ext) occ_clip5_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip5_url.substring(0, occ_clip5_url.lastIndexOf('.'))+video_extension; else occ_clip5_url = params.avatar_db_response[idx].avatar_data[0].rootdir + occ_clip5_url + clip_suffix[video_extension] + video_extension; so.addVariable("occasionalClip5", occ_clip5_url); so.addVariable("probability5", params.avatar_db_response[idx].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("avatar_avatarvideo"+idx); $("#avatar_avatarvideo"+idx+" #recorder"+idx).css('display','block').css('position','relative').css('float','left'); if(!params.avatar_db_response[idx].flv_exists) { $("#avatar_avatarvideo"+idx).prepend("
"+avatar_frame); if(params.avatar_num_questions[idx] == 0) { $("#avatar_avatarvideo"+idx).append("
"); //$("#avatar_avatarvideo"+idx+" .avatar_rightframe").css('position','relative').css('top','0px'); } } } else { //Create the html5 avatar //----------------------------------------------------------------- var screenshot = params.avatar_db_response[idx].avatar_data[0].rootdir+ params.avatar_screenshot[idx]; if(!has_ext) { screenshot = screenshot+".jpg"; } if(params.avatar_db_response[idx].avatar_data[0].initial_clip!=""){ if(params.avatar_num_questions[idx] == 0) { var float_text = 'How did you find us?'; var span_width = 176; } else { var float_text = 'Go ahead! Ask me a question!'; var span_width = 230; } if($.smartsite_readCookie(params.avatar_oid+"survey")== null){ $("#avatar_avatarvideo"+idx).append("
"+avatar_frame+"
"+float_text+"
"); } else{ $("#avatar_avatarvideo"+idx).append("
"+avatar_frame+"
"+float_text+"
"); if(params.avatar_num_questions[idx] == 0) { $("#avatar_avatarvideo"+idx+" .avatar_overlay span").css('display','none'); } } var span_to_left = (400 -span_width)/2 + 20; $("#avatar_avatarvideo"+idx+" .avatar_overlay span").css('left',span_to_left+'px').css('top','200px'); $("#avatar_avatarvideo"+idx+" video").bind('ended',function(){ $("#avatar_avatarvideo"+idx+" .avatar_overlay").css('visibility','visible'); $(this).bind('playing',function(){ $("#avatar_avatarvideo"+idx+" .avatar_overlay").css('visibility','hidden'); }); }); if(params.avatar_num_questions[idx] == 0) { //$("#avatar_avatarvideo"+idx+" .ht").css('right','20px'); $("#avatar_avatarvideo"+idx).append("
"); } } if(isMobile.any()) { $("#avatar_avatarvideo"+idx+" .avatar_overlay").bind('touchstart',function(e){ $("#avatar_avatarvideo"+idx+" video").bind('playing',function(){ $("#avatar_avatarvideo"+idx+" .avatar_overlay").css('visibility','hidden'); }); $(this).next().trigger('play'); }); } else { $("#avatar_avatarvideo"+idx+" .avatar_overlay img, #avatar_avatarvideo"+idx+" .avatar_overlay span").bind('click',function(e){ $("#avatar_avatarvideo"+idx+" video").bind('playing',function(){ $("#avatar_avatarvideo"+idx+" .avatar_overlay").css('visibility','hidden'); }); $(this).parent().next().trigger('play'); }); } } $('#smartsite_avatar'+idx).css('zIndex',9999); if($('#avatar_avatarvideo'+idx).children().length>0) { //$('#avatar_avatarvideo'+idx).children().last().css('width','400px'); //$('#avatar_avatarvideo'+idx).children().last().css('height','300px'); $('#avatar_avatarvideo'+idx).children('video').css('width','400px'); $('#avatar_avatarvideo'+idx).children('video').css('height','300px'); } //Change the icon //----------------------------------------------------------------- $('#avatar_icon_standard'+idx).css("display","none"); $('#avatar_icon_over'+idx).css("display","none"); $('#avatar_icon_close'+idx).css("display","block"); //Lock SmartConnect tools so no other tools can open while the animtion is occurring //----------------------------------------------------------------- params.avatar_opening=true; try{smart_z_lock();}catch(e){} var lowerbar_topDist = $('#smartsite_avatar'+idx).height()/2-23+'px'; //If sliding out to the left, calculate and begin left slide animation //----------------------------------------------------------------- if(params.avatar_db_response[idx].avatar_data[0].direction=="left"){ //write_log('move to left'); $('#avatar_lowerbarcontainer'+idx).css('top',lowerbar_topDist); $('#avatar_lowerbarcontainer'+idx).css('left','-672px'); $('#avatar_lowerbar'+idx).css('left','672px'); params.avatar_opening_effectobj.MoveEffect(-672, 0, 1, "avatar_lowerbar"+idx, function(){$(this).avatar('movebardown',idx);}); //$("#avatar_lowerbar"+idx).animate({left: '-=672'},1000,'linear',function(){$(this).avatar('movebardown',idx);}); } else { //write_log('move to right'); $('#avatar_lowerbarcontainer'+idx).css('top',lowerbar_topDist); $('#avatar_lowerbarcontainer'+idx).css('left',$("#smartsite_avatar"+idx).css('width')); $('#avatar_lowerbar'+idx).css('left','-672px'); params.avatar_opening_effectobj.MoveEffect(672, 0, 1, "avatar_lowerbar"+idx, function(){$(this).avatar('movebardown',idx);}); //$("#avatar_lowerbar"+idx).animate({left: '+=672'},1000,'linear',function(){$(this).avatar('movebardown',idx);}); } $('#avatar_cont'+idx).css("display","block"); }, //Perform the second stage of the animation, moving the sliding bar into the position that the avatar will appear in movebardown:function(idx){ //Store the position of the bar at this stage of the animation so it may be returned to when closing //----------------------------------------------------------------- params.avatar_initialX[idx]=$('#avatar_lowerbarcontainer'+idx).position().left; params.avatar_initialY[idx]=$('#avatar_lowerbarcontainer'+idx).position().top; params.avatar_opening_effectobj.MoveEffect(params.avatar_db_response[idx].avatar_data[0].left-params.avatar_initialX[idx], params.avatar_db_response[idx].avatar_data[0].top-params.avatar_initialY[idx], 1, "avatar_lowerbarcontainer"+idx, function(){$(this).avatar('showpanel',idx)}); //$("#avatar_lowerbarcontainer"+idx).animate({left:'+='+(params.avatar_db_response[idx].avatar_data[0].left-params.avatar_initialX[idx]), top:'+='+(params.avatar_db_response[idx].avatar_data[0].top-params.avatar_initialY[idx])},1000,'linear',function(){$(this).avatar('showpanel',idx);}); }, //Perform the third stage of the animation, sliding the avatar panel out of the bar showpanel:function(idx){ //Show the avatar panel by sliding it from the bar //----------------------------------------------------------------- var leftDist=$('#avatar_lowerbarcontainer'+idx).position().left +8; var topDist = $('#avatar_lowerbarcontainer'+idx).position().top; if(params.avatar_num_questions[idx] != 0 && params.avatar_db_response[idx].avatar_data[0].transcript=="1") { $('#avatar_transcript'+idx).css('left',leftDist + 140 +'px'); $('#avatar_transcript'+idx).css('top',topDist + 13 + 'px'); } if($("#avatar_avatarcallclosebutton"+idx).length>0) $("#avatar_avatarcallclosebutton"+idx).css("display","block"); //$('#avatar_avatarvideo'+idx).css('left',leftDist+'px'); //$('#avatar_avatarvideo'+idx).css('top',topDist + 8 + 'px'); //Put panel div in correct position //----------------------------------------------------------------- if(params.avatar_num_questions[idx] != 0) { if(!params.avatar_support_flash || !params.avatar_db_response[idx].flv_exists ) { $('#avatar_videoholder'+idx).css('left',leftDist + 29-38 +'px'); $('#avatar_videoholder'+idx).css('top',topDist - 292-38 + 'px'); $('#avatar_avatarvideo'+idx).css('left','438px'); $('#avatar_avatarvideo'+idx).css('top','38px'); } else { $('#avatar_videoholder'+idx).css('left',leftDist +20 +'px'); $('#avatar_videoholder'+idx).css('top',topDist - 292 + 'px'); $('#avatar_avatarvideo'+idx).css('left','0px'); $('#avatar_avatarvideo'+idx).css('top','0px'); } $('#avatar_textAreaContainer'+idx).css('top',topDist - (question_panel_height-8) +'px').css('left',leftDist + 420 + 'px'); if($('#avatar_transcript_panel'+idx).length>0) { $('#avatar_transcript_panel'+idx).css('top',topDist - 75 + 'px').css('left',leftDist + 658 + 'px').css('display','block'); } //slide down the IFoundYouThrough form after avatar is fully opened params.avatar_opening_effectobj.MoveEffect(0, -1*question_panel_height, 1, "textArea"+idx, function(){ if(params.avatar_hasSurvey[idx]){ if($.smartsite_readCookie(params.avatar_oid+"survey")== null) { $(this).avatar('showform',idx); } else { $(this).avatar('fullyopened',idx); } } else { $(this).avatar('fullyopened',idx); } }); } else { if(!params.avatar_support_flash || !params.avatar_db_response[idx].flv_exists ) { $('#avatar_videoholder'+idx).css('left',leftDist + 29-38 +'px'); $('#avatar_videoholder'+idx).css('top',topDist - 292-38 + 'px'); $('#avatar_avatarvideo'+idx).css('left','18px'); $('#avatar_avatarvideo'+idx).css('top','338px'); } else { $('#avatar_videoholder'+idx).css('left',leftDist + 20 +'px'); $('#avatar_videoholder'+idx).css('top',topDist - 292 + 'px'); $('#avatar_avatarvideo'+idx).css('left','0px'); $('#avatar_avatarvideo'+idx).css('top','300px'); } if(params.avatar_hasSurvey[idx] && $.smartsite_readCookie(params.avatar_oid+"survey")== null) { $(this).avatar('showform',idx); } else { $(this).avatar('fullyopened',idx); } } //Display the transcript if there is one //----------------------------------------------------------------- if(params.avatar_num_questions[idx] != 0 && $('#avatar_transcript'+idx).length>0) $('#avatar_transcript'+idx).css('display','block'); $('#avatar_statusDiv'+idx).css('display','block'); }, //Perform the Fourth stage of the animation, sliding down the IFoundYouThrough form showform:function(idx){ //get the top position for the form container var toTop = $('#avatar_lowerbarcontainer'+idx).position().top + $('#avatar_lowerbarcontainer'+idx).height() -10; $('#avatar_formDivContainer'+idx).css('top',toTop + 'px'); //fixing position problems in certain browers like safari var toLeft = $('#avatar_lowerbarcontainer'+idx).position().left; $('#avatar_formDivContainer'+idx).css('left',toLeft + 'px'); var formHeight = $('#avatar_formDivContainer'+idx).height(); //put the form out of the container $('#avatar_formDiv'+idx).css('top', -1*formHeight + 'px'); //animate the form to move it back to the container params.avatar_opening_effectobj.MoveEffect(0, formHeight, 1, "avatar_formDiv"+idx, function(){$(this).avatar('fullyopened',idx);}); }, //Finalize the video opening process fullyopened:function(idx){ //Display the avatar div //----------------------------------------------------------------- if(params.avatar_num_questions[idx] != 0) { var avatar_width = $("#avatar_avatarvideo"+idx).width(); if($("#avatar_topframe"+idx).length > 0) { $('#avatar_avatarvideo'+idx).css("display","block"); var avatar_topframe_width = $("#avatar_topframe"+idx).width(); $("#avatar_topframe"+idx).css('display','block'); params.avatar_trans_effectobj.MoveEffect(-1*avatar_topframe_width, 0, 0.4, "avatar_topframe"+idx, function(){ }); params.avatar_opening_effectobj.MoveEffect(-1*avatar_width, 0, 0.5, "avatar_avatarvideo"+idx, function(){ $(this).avatar('finish',idx); }); } else { //no frames around the video $('#avatar_avatarvideo'+idx).css('left', '0px').css('display','block'); $(this).avatar('finish',idx); } } else { if($("#avatar_topframe"+idx).length > 0) { $('#avatar_avatarvideo'+idx).css("display","block"); $("#avatar_topframe"+idx).css('display','block'); params.avatar_trans_effectobj.MoveEffect(0, -1*$("#avatar_videoholder"+idx).height(), 0.5, "avatar_topframe"+idx, function(){ }); params.avatar_opening_effectobj.MoveEffect(0, -300, 0.5, "avatar_avatarvideo"+idx, function(){ $(this).avatar('finish',idx); }); } else { $('#avatar_avatarvideo'+idx).css('top', '0px').css('display','block'); $(this).avatar('finish',idx); } } }, finish:function(idx){ if(params.avatar_num_questions[idx] != 0){ $('#avatar_scrolling_div'+idx).css("display","block"); } //Now that the avatar is finished opening, unlock to allow closing or other SmartConnect tools opening //----------------------------------------------------------------- params.avatar_opening=false; smart_z_unlock(); params.avatar_opened=true; setSwapFunc($.avatar_closeAvatarDiv, idx); } }; $.fn.avatar = function( method ) { if ( methods[method] ) { //execute a method of avatar return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { //initialize avatar return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.avatar' ); } }; $.avatar_ccInitiate = function(idx){ //If the panel is in the process of being closed, don't allow this action //----------------------------------------------------------------- if(params.avatar_showClickTransitioning==true) return; //Make sure a phone number has been entered //----------------------------------------------------------------- if($("#avatar_ccform"+idx+" #tocall").val() == '' || $("#avatar_ccform"+idx+" #tocall").val() == "Enter Your Phone Number") { alert("Please enter your phone number."); } //Post to iframe to connect the call //----------------------------------------------------------------- else { //Save the phone number in a cookie $.smartsite_createCookie("avatar_phone",$("#avatar_ccform"+idx+" #tocall").val(),90); $('#avatar_postframe'+idx).attr('src','http://www.elocallink.tv/zyte/call_it_s.php?number='+$("#avatar_ccform"+idx+" #tocall").val()+'&destcall='+params.avatar_db_response[idx].avatar_data[0].remote_click_to_call_phone+'&cc_notify='+params.avatar_db_response[idx].avatar_data[0].remote_cc_email); $.avatar_retractClickCall(idx); } } $.create_survey_options = function(json, idx){ var numOfOptions = json.surveyopt.length; var numOfRows = Math.ceil(numOfOptions/3) ; //creating options for(var i=1; i<=numOfOptions; i++) { var current_row = Math.ceil(i/3); switch(i%3) { case 1: if(json.surveyopt[i-1].option == 'Other') { $('#IFoundYouForm'+idx).append("
"); $('#form'+idx+'_row'+current_row).append("
Other
"); } else{ $('#IFoundYouForm'+idx).append("
"); $('#form'+idx+'_row'+current_row).append("
"+json.surveyopt[i-1].option+"
"); } break; case 2: if(json.surveyopt[i-1].option == 'Other'){ $('#form'+idx+'_row'+current_row).append("
Other
"); } else{ $('#form'+idx+'_row'+current_row).append("
"+json.surveyopt[i-1].option+"
"); } break; case 0: if(json.surveyopt[i-1].option == 'Other'){ $('#form'+idx+'_row'+current_row).append("
Other
"); } else{ $('#form'+idx+'_row'+current_row).append("
"+json.surveyopt[i-1].option+"
"); } break; }//end of switch }//end of for loop //creating a submit button $('#IFoundYouForm'+idx).append('
If you see this, leave this form field blank and invest in CSS support.
'); } //Check if the video should be auto-centered, if so, calculate the center //----------------------------------------------------------------- $.avatar_checkAutoCenter = function(num){ //If the video should be auto-centered, calculate the center //----------------------------------------------------------------- var avatar_offset = $('#smartsite_avatar'+num).offset(); var avatar_leftDistance= avatar_offset.left; var avatar_topDistance = avatar_offset.top; var scrolldist = $(document).scrollTop(); if(params.avatar_db_response[num].avatar_data[0].autocenter==true){ params.avatar_db_response[num].avatar_data[0].left= ($(document).width()-672)/2 - avatar_leftDistance; if(params.avatar_hasSurvey[num] && $.smartsite_readCookie(params.avatar_oid+"survey")== null) { params.avatar_db_response[num].avatar_data[0].top=$(window).height()/2-avatar_topDistance+141+scrolldist -170/2; //170 is the average form height //params.avatar_db_response[num].avatar_data[0].top=($(window).height()-avatar_topDistance+scrolldist)/2 + -170/2; //170 is the form height } else { params.avatar_db_response[num].avatar_data[0].top=$(window).height()/2-avatar_topDistance+141+scrolldist; } } /* write_log("window width:"+$(window).width()); write_log("window height:"+$(window).height()); write_log("avatar left:"+params.avatar_db_response[num].avatar_data[0].left); write_log("avatar top:"+params.avatar_db_response[num].avatar_data[0].top); write_log("scrolldist:"+scrolldist);*/ //Set the direction the avatar panel should slide out //----------------------------------------------------------------- if(params.avatar_db_response[num].avatar_data[0].left>-120) params.avatar_db_response[num].avatar_data[0].direction='right'; else params.avatar_db_response[num].avatar_data[0].direction='left'; } //Update the position of elements within the avatar panel HTML //----------------------------------------------------------------- $.avatar_refreshDependentPositions = function(num){ if($("#avatar_statusDiv"+num).length>0){ if(params.avatar_num_questions[num] != 0) { $("#avatar_statusDiv"+num).css('left',(Number(params.avatar_db_response[num].avatar_data[0].left)+155)+"px"); } else { $("#avatar_statusDiv"+num).css('left',(Number(params.avatar_db_response[num].avatar_data[0].left)+125)+"px"); } $("#avatar_statusDiv"+num).css('top',(Number(params.avatar_db_response[num].avatar_data[0].top)+17)+"px"); } if($("#avatar_avatarcallclosebutton"+num).length>0){ $("#avatar_avatarcallclosebutton"+num).css('left',(Number(params.avatar_db_response[num].avatar_data[0].left)+109)+"px"); $("#avatar_avatarcallclosebutton"+num).css('top',(Number(params.avatar_db_response[num].avatar_data[0].top)+10)+"px"); } if($("#avatar_calldiv"+num).length>0){ $("#avatar_calldiv"+num).css('left',(Number(params.avatar_db_response[num].avatar_data[0].left)+112)+"px"); $("#avatar_calldiv"+num).css('top',(Number(params.avatar_db_response[num].avatar_data[0].top)+28)+"px"); } } //Show click to call panel //----------------------------------------------------------------- $.avatar_showClickCall = function(num) { //If click to call is already animating, cancel this //----------------------------------------------------------------- if(params.avatar_showClickTransitioning==true) return; //If click to call is open, hide it //----------------------------------------------------------------- if(params.avatar_showClickOpen==true) {$.avatar_retractClickCall(num); return;} params.avatar_showClickTransitioning=true; $('#avatar_calldiv'+num).css('display','block'); //Move the click to call panel //----------------------------------------------------------------- params.avatar_click_effectobj.MoveEffect(0, 45, 1, "calldivback"+num, function(){params.avatar_showClickTransitioning=false;params.avatar_showClickOpen=true;}); //Check to see if a pre-existing number is saved in a cookie //----------------------------------------------------------------- preexistingNumber=$.smartsite_readCookie("avatar_phone"); if(preexistingNumber!=null){ $("#avatar_ccform"+num+" #tocall").val(preexistingNumber); } else{ $("#avatar_ccform"+num+" #tocall").val("Enter Your Phone Number"); } } //Play an avatar clip //Change the title to the default, "Go ahead, ask me a question" //----------------------------------------------------------------- $.avatar_playClip = function(ival, pos){ //Change the transcript text, if there is one //----------------------------------------------------------------- if(params.avatar_db_response[pos].avatar_data[0].transcript==true) $("#current_transcript"+pos).html(params.avatar_db_response[pos].questions[ival].transcript); if(params.avatar_last_clicked != -1) { $("#avatar_cont"+pos+" .avatar_question_text").eq(params.avatar_last_clicked).css('color','white'); } $("#avatar_cont"+pos+" .avatar_question_text").eq(ival).css('color','#888'); //Store the last question clicked //----------------------------------------------------------------- params.avatar_last_clicked=ival; //Trim the question title length and display it //----------------------------------------------------------------- if(params.avatar_db_response[pos].questions[ival].question.length<80) $('#avatar_statusDiv'+pos).html(params.avatar_db_response[pos].questions[ival].question); else $('#avatar_statusDiv'+pos).html(params.avatar_db_response[pos].questions[ival].question.substr(0,71)+"..."); //Post universal_tracking script to iframe to track this question playback //----------------------------------------------------------------- $("#avatar_postframe2_"+pos).attr("src","http://www.smartsite.tv/tracking/universal_tracking.php?pid="+params.avatar_oid+"&insert_type=avatar&etx="+params.avatar_db_response[pos].questions[ival].enc_question); var question_clip = params.avatar_db_response[pos].questions[ival].clip_url; if(has_ext) question_clip = params.avatar_db_response[pos].avatar_data[0].rootdir + question_clip.substring(0, question_clip.lastIndexOf('.'))+video_extension; else question_clip = params.avatar_db_response[pos].avatar_data[0].rootdir + question_clip + clip_suffix[video_extension] + video_extension; if(params.avatar_support_flash) { //Send command to SWF to play new clip //----------------------------------------------------------------- $.avatar_getSWF("recorder"+pos).playNewClip(question_clip, true); } else { //play html5 video $.playHtml5Video(question_clip, pos, ival); } } $.playHtml5Video = function(url, num, q_idx){ var myvideo = document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0]; if(!myvideo.paused) { myvideo.pause(); } /*if(!document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].paused) { document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].pause(); }*/ $("#avatar_avatarvideo"+num+" .avatar_overlay span").text('Thinking...'); var span_to_left = (400 -$("#avatar_avatarvideo"+num+" .avatar_overlay span").outerWidth())/2 + 20; $("#avatar_avatarvideo"+num+" .avatar_overlay span").css('left',span_to_left+'px').css('top','200px'); $("#avatar_avatarvideo"+num+" .avatar_overlay").css('visibility','visible'); $("#avatar_avatarvideo"+num+" video source").attr('src',''); //document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].load(); $("#avatar_avatarvideo"+num+" video").remove(); //$("#avatar_avatarvideo"+num+" video source").attr('src',url); //myvideo.load(); //document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].load(); $("#avatar_avatarvideo"+num).append(""); $("#avatar_avatarvideo"+num+" video").bind('playing',function(){ if(isMobile.Android()) { $("#avatar_avatarvideo"+num+" video").bind('timeupdate',function(){ if(document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].currentTime >0) { //write_log(document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].currentTime); $("#avatar_avatarvideo"+num+" .avatar_overlay").css('visibility','hidden'); } }); } else { $("#avatar_avatarvideo"+num+" .avatar_overlay").css('visibility','hidden'); } }); document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].play(); /* setTimeout(function(){ //myvideo.play(); //$("#avatar_avatarvideo"+num+" video").trigger('play'); document.getElementById("avatar_avatarvideo"+num).getElementsByTagName('video')[0].play(); },200);*/ $("#avatar_avatarvideo"+num+" video").bind('ended',function(){ $("#avatar_avatarvideo"+num+" .avatar_overlay span").text('Go ahead! Ask me a question!'); span_to_left = ($("#avatar_avatarvideo"+num+" video").width() -$("#avatar_avatarvideo"+num+" .avatar_overlay span").outerWidth())/2 + 20; $("#avatar_avatarvideo"+num+" .avatar_overlay span").css('left',span_to_left+'px').css('top','200px'); $("#avatar_avatarvideo"+num+" .avatar_overlay").css('visibility','visible'); }); } /*window.onorientationchange = $.detectIPadOrientation; $.detectIPadOrientation = function() { if ( orientation == 0 ) { alert ('Portrait Mode, Home Button bottom'); } else if ( orientation == 90 ) { alert ('Landscape Mode, Home Button right'); } else if ( orientation == -90 ) { alert ('Landscape Mode, Home Button left'); } else if ( orientation == 180 ) { alert ('Portrait Mode, Home Button top'); } }*/ //Cross-browser function to obtain reference to embedded SWF //----------------------------------------------------------------- $.avatar_getSWF = function(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 0) { //have frames around the video var topframe_width = $("#avatar_topframe"+num).width(); //retract the top frame back to the question panel params.avatar_trans_effectobj.MoveEffect(topframe_width, 0, 0.5, "avatar_topframe"+num, function(){ $("#avatar_topframe"+num).css('display','none'); }); //retract the video back to the question panel params.avatar_closing_effectobj.MoveEffect(420, 0, 0.4, "avatar_avatarvideo"+num, function(){ if(params.avatar_support_flash){ $.avatar_getSWF("recorder"+num).fadeOut(); } else { $("#avatar_avatarvideo"+num+" video")[0].pause(); $("#avatar_avatarvideo"+num+" video").fadeOut(); } $.retract_questions(num); }); } else { //no frames around the video. fadeout the video directly if(params.avatar_support_flash){ $.avatar_getSWF("recorder"+num).fadeOut(); } else { $("#avatar_avatarvideo"+num+" video")[0].pause(); $("#avatar_avatarvideo"+num+" video").fadeOut(); } $.retract_questions(num); } } else { //contain the question panel var y1 = $("#avatar_avatarvideo"+num).position().top + $("#avatar_avatarvideo"+num).height(); var y2 = $("#avatar_videoholder"+num).height(); //move the video down params.avatar_closing_effectobj.MoveEffect(0, y1 , 0.5, "avatar_avatarvideo"+num, function(){ if(params.avatar_support_flash){ $.avatar_getSWF("recorder"+num).fadeOut(); } else { $("#avatar_avatarvideo"+num+" video")[0].pause(); $("#avatar_avatarvideo"+num+" video").fadeOut(); } $.retract_questions(num); }); if($("#avatar_topframe"+num).length > 0) { params.avatar_trans_effectobj.MoveEffect(0, y2, 0.5, "avatar_topframe"+num, function(){ $("#avatar_topframe"+num).css('display','none'); }); } } } $.retract_questions = function(num){ //----------------------------------------------------------------- params.avatar_closing=true; smart_z_lock(); params.avatar_opened=false; clearSwapFunc(); if(params.avatar_num_questions[num] != 0){ $('#avatar_scrolling_div'+num).css('display','none'); } //Change the icon //----------------------------------------------------------------- $('#avatar_icon_standard'+num).css('display','block'); $('#avatar_icon_over'+num).css('display','none'); $('#avatar_icon_close'+num).css('display','none'); //Close the text panel after a set amount of time //----------------------------------------------------------------- setTimeout(function(){ params.avatar_closing=true; smart_z_lock(); $("#avatar_avatarvideo"+num).css('display','none'); $("#avatar_lowershadow"+num).html(''); if(params.avatar_num_questions[num] != 0){ params.avatar_closing_effectobj.MoveEffect(0, question_panel_height, 1, "textArea"+num, function(){ if(params.avatar_hasSurvey[num]){ if($.smartsite_readCookie(params.avatar_oid+"survey")== null){ $.avatar_closeForm(num); } else{ $.avatar_closeBar(num); } } else { $.avatar_closeBar(num); } if(params.avatar_redirection_address != ""){ window.location = params.avatar_redirection_address; } }); } else { if(params.avatar_hasSurvey[num]){ if($.smartsite_readCookie(params.avatar_oid+"survey")== null){ $.avatar_closeForm(num); } else{ $.avatar_closeBar(num); } } else { $.avatar_closeBar(num); } if(params.avatar_redirection_address != ""){ window.location = params.avatar_redirection_address; } } }, 600); } //Second stage of closing animation, animate the form returning to its original slid-out position $.avatar_closeForm = function(num){ //get the height of the form var formHeight = $("#avatar_formDivContainer"+num).height(); params.avatar_closing_effectobj.MoveEffect(0, -1*formHeight, 1, "avatar_formDiv"+num, function(){$.avatar_closeBar(num);}); } //Third stage of closing animation, animate the bar returning to its original slid-out position //----------------------------------------------------------------- $.avatar_closeBar = function(num){ //Hide elements //----------------------------------------------------------------- if($("#avatar_avatarcallclosebutton"+num).length>0) $("#avatar_avatarcallclosebutton"+num).css('display','none'); if($("#avatar_transcript"+num).length>0) $("#avatar_transcript"+num).css('display','none'); $("#avatar_transcript_panel"+num).css('display','none'); $("#avatar_statusDiv"+num).css('display','none'); if(params.avatar_hasSurvey[num] && $.smartsite_readCookie(params.avatar_oid+"survey")== null){ if(params.avatar_num_questions[num] != 0){ $("#avatar_statusDiv"+num).text('Please take a quick moment to tell me how you found us...'); } else { $("#avatar_statusDiv"+num).html('Please take a quick moment to tell me how you found us...'); } } else if(params.avatar_hasSurvey[num] && $.smartsite_readCookie(params.avatar_oid+"survey")!= null){ if(params.avatar_num_questions[num] != 0){ $("#avatar_statusDiv"+num).text('Go ahead, ask me a question.'); } else { $('#avatar_statusDiv'+num).html('Thank you. You already told us how you found us.'); } } else if(!params.avatar_hasSurvey[num]){ if(params.avatar_num_questions[num] != 0){ $("#avatar_statusDiv"+num).text('Go ahead, ask me a question.'); } else { $('#avatar_statusDiv'+num).html(''); } } $('#avatar_avatarvideo'+num).html(''); //Get the current bar position //----------------------------------------------------------------- var cx=$('#avatar_lowerbarcontainer'+num).css('left'); pos=cx.indexOf("p"); cx=String(cx).substr(0,pos); var cy=$('#avatar_lowerbarcontainer'+num).css('top'); pos=cy.indexOf("p"); cy=String(cy).substr(0,pos); //Slide the bar back to its original, slid-out position //----------------------------------------------------------------- params.avatar_closing_effectobj.MoveEffect(params.avatar_initialX[num]-cx, params.avatar_initialY[num]-cy, 1, "avatar_lowerbarcontainer"+num, function(){$.avatar_retractBar(num);}); } //Fourth stage of closing animation, retract the bar back into the icon //----------------------------------------------------------------- $.avatar_retractBar = function(num){ //Depending on the direction the bar originally slid out from, animate it sliding back into the icon //----------------------------------------------------------------- if(params.avatar_db_response[num].avatar_data[0].direction=="left"){ params.avatar_closing_effectobj.MoveEffect(672, 0, 1, "avatar_lowerbar"+num, function(){$.avatar_hideAvatarDiv(num);}); } else{ params.avatar_closing_effectobj.MoveEffect(-672, 0, 1, "avatar_lowerbar"+num, function(){$.avatar_hideAvatarDiv(num);}); } //$("#avatar_cont"+num).find(".avatar_highlighted_question").removeClass('avatar_highlighted_question'); $("#avatar_cont"+num).find(".avatar_question_text").css('color','white'); } $.submit_IFYT_form = function(pos, options_count){ var result_arr = []; var result_option_arr = []; var numOfCheckbox = options_count-1; var numOfChecked = 0; var theIP = "3.147.72.65"; var isValid = false; var user_email = $("#avatar_source_div input").val(); for(i=1;i<=numOfCheckbox;i++){ var checkboxId = "form"+pos+"_option"+i; var option_id = "form" + pos+"_optionId"+i; //if(document.getElementById(checkboxId).checked) if($("#"+checkboxId).is(':checked')) { result_arr.push($("#"+checkboxId).val()); result_option_arr.push($("#"+option_id).val()); numOfChecked++; } } if(numOfChecked == 0){ if($('#form'+pos+'_text').val() == ''){ alert("You must choose at least an option"); isValid = false; } else{ isValid = true; var other_tf = $('#form'+pos+'_text').val(); result_option_arr.push($("#form" + pos +"_optionId"+options_count).val()); if(user_email == '') $("#avatar_postframe2_"+pos).attr("src","http://www.nxnotes.com/proc/next_db_responder.php?action_request=process_smartavatar_next&other="+encodeURIComponent(other_tf)+"&pid="+params.avatar_oid+"&userIP="+theIP+"&result_options="+result_option_arr); } } else{ isValid = true; if(user_email == '') { if($('#form'+pos+'_text').val() == ''){ $("#avatar_postframe2_"+pos).attr("src","http://www.nxnotes.com/proc/next_db_responder.php?action_request=process_smartavatar_next&results="+result_arr+"&pid="+params.avatar_oid+"&userIP="+theIP+"&result_options="+result_option_arr); } else{ var other_tf = $('#form'+pos+'_text').val(); result_option_arr.push($("#form" + pos +"_optionId"+options_count).val()); $("#avatar_postframe2_"+pos).attr("src","http://www.nxnotes.com/proc/next_db_responder.php?action_request=process_smartavatar_next&results="+result_arr+"&other="+encodeURIComponent(other_tf)+"&pid="+params.avatar_oid+"&userIP="+theIP+"&result_options="+result_option_arr); } } } if(isValid) { if(params.avatar_support_flash) { //console.log(params.avatar_db_response[pos].avatar_data[0].rootdir+params.avatar_db_response[pos].avatar_data[0].occ_clip1); $.avatar_getSWF("recorder"+pos).playNewClip(params.avatar_db_response[pos].avatar_data[0].rootdir+params.avatar_db_response[pos].avatar_data[0].occ_clip1, true); } else { //play html5 "thanks" video } var formHeight = $('#avatar_formDivContainer'+pos).height(); params.avatar_closing_effectobj.MoveEffect(0, -1*formHeight, 1, "avatar_formDiv"+pos, function(){ //remove the form DIV from the document $('#avatar_formDiv'+pos).remove(); //creating a cookie $.smartsite_createCookie(params.avatar_oid+"survey","true", 365); if(params.avatar_num_questions[pos] != 0) { $('#avatar_statusDiv'+pos).html("Go ahead, ask me a question."); } else { $("#avatar_avatarvideo"+pos+" .avatar_overlay span").css('display','none'); $('#avatar_statusDiv'+pos).html('Thank you.'); setTimeout(function(){ $.avatar_closeAvatarDiv(pos); },3000); } }); } } //Finalize avatar closing animation //----------------------------------------------------------------- $.avatar_hideAvatarDiv = function(num){ $('#avatar_cont'+num).css('display','none'); //avatarShowing=false; params.avatar_closing=false; smart_z_unlock(); params.avatar_now_opened=-1; $('#smartsite_avatar'+num).css('zIndex',params.avatar_originalZ); } //$.extend($.fn.avatar, params); //This function not renamed 'smartavatar' because it is called from the swf file //Change the title to the default, "Thank you. You already told us how you found us." //----------------------------------------------------------------- $.avatar_resetStatusDesc = function(){ var opened_avatar_idx = params.avatar_now_opened; if(params.avatar_hasSurvey[opened_avatar_idx] && $.smartsite_readCookie(params.avatar_oid+"survey")== null){//if the IFoundYouThrough form exists if(params.avatar_num_questions[opened_avatar_idx] != 0) { $('#avatar_statusDiv'+params.avatar_now_opened).html("Please take a quick moment to tell me how you found us..."); } else { $('#avatar_statusDiv'+params.avatar_now_opened).html('Please take a quick moment to tell me how you found us...'); } } else if(params.avatar_hasSurvey[opened_avatar_idx] && $.smartsite_readCookie(params.avatar_oid+"survey")!= null){ if(params.avatar_num_questions[opened_avatar_idx] != 0) { $('#avatar_statusDiv'+params.avatar_now_opened).html("Go ahead, ask me a question."); } else { $('#avatar_statusDiv'+params.avatar_now_opened).html('Thank you. You already told us how you found us.'); } } else if(!params.avatar_hasSurvey[opened_avatar_idx]) { if(params.avatar_num_questions[opened_avatar_idx] != 0) { $('#avatar_statusDiv'+params.avatar_now_opened).html("Go ahead, ask me a question."); } else { $('#avatar_statusDiv'+params.avatar_now_opened).html(''); } } } $.stripslashes = function(str) { return (str + '').replace(/\\(.?)/g, function (s, n1) { switch (n1) { case '\\': return '\\'; case '0': return '\u0000'; case '': return ''; default: return n1; } }); }; /* ###Default implementation smartobject initiation */ $(function(){ if(!+"\v1"){smartsite_is_IE6 = ((parseFloat(navigator.userAgent.substring((navigator.userAgent.indexOf("MSIE"))+5))==6)?1:0); } $('smartobject').smartobject(); //If the tools included on the page require smart_z_manager.js, which manages auto-opening, and there are no image icons to load, dynamically add smart_z_manager.js //-------------------------------------------------------------------------------- if(smart_v_included==true && waitingForImageCounter==0){ $.addScript("http://www.smartsite.tv/remote/smart_z_managerV2.js", 0); } }); /* #AVOID COLLISIONS #*/ })(jQuery); /* #AVOID COLLISIONS #*/ //This function not renamed 'smartavatar' because it is called from the swf file //Change the title to the default, "Thank you. You already told us how you found us." //----------------------------------------------------------------- function ZyteAvatar_resetStatusDesc(){ if(jQuery){ jQuery.avatar_resetStatusDesc(); } }