var lc_name; var showURL; var objWidth; var objHeight; var returnFlagPage=1; var onPagePlayBackSceneId=0; function domainOfPage() { domainName = document.location.hostname; if(domainName.length<=0) domainName = 'not_found'; return domainName; } function AC_Voki_App_Embed (bUrl, chsm, aName, pName) { bUrl = unescape(bUrl); var bHght = 750; var bWdt = 890; url = 'http://apps.voki.com/' + pName + '/' + aName + '/?' +location.search + '&baseUrl=' + bUrl + '&chsm=' + chsm + '&iFrm=1'; document.write(''); } function AC_Voki_Embed (width, height, chsm, sc, transparent, bgcolor, returnFlag, name, autoPlay) { var extraParam = ''; if (name) { vokiName = name; vokiEmbedName = name; } else { if(!document.VoKi) { if(window.name){ vokiName = window.name; vokiEmbedName = window.name; if (navigator.appName.indexOf("Microsoft") != -1){ vokiEmbedName = window.name +'2'; } }else{ vokiName = 'VoKi'; vokiEmbedName = 'VoKi'; if (navigator.appName.indexOf("Microsoft") != -1){ vokiEmbedName = 'VoKi2'; } } } else { vokiName = 'VoKi' + Math.floor(Math.random() * 1000000000); vokiEmbedName ='VoKi2' + Math.floor(Math.random() * 1000000000); } } if(returnFlag == undefined) returnFlag = 1; if(autoPlay != undefined){ extraParam = '&playOnLoad='+autoPlay; } objWidth = width; objHeight = height; tokenString = '&token=0a45cef5c320e2560c4e50cae35abd6d'; justEdited = false; if(window.checkUncachedVoki){ justEdited = checkUncachedVoki(sc); } NotAccelServer = 'http://vhss.oddcast.com'; AccelServer = 'http://vhss-d.oddcast.com'; getVoki = escape((justEdited?NotAccelServer:AccelServer)+'/php/vhss_editors/getvoki/chsm='+chsm+'&sc='+sc+(justEdited?'&edited=1':'')+'?r='+parseInt(Math.random()*10000000)); url = 'http://vhss-d.oddcast.com/vhss_editors/voki_player.swf?js=1&doc='+getVoki+extraParam; showURL = url; flashVersion = 6; returnFlagPage = returnFlag; onPagePlayBackSceneId = sc; if (transparent != 1){ strObj = AC_RunFlContentX( 'height',height,'swliveconnect','true','src',url,'scale','noborder','id',vokiName,'width',width,'bgcolor','#'+bgcolor,'quality','high','movie',url,'name',vokiEmbedName,'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashVersion+',0,0,0', 'allowScriptAccess', 'always'); }else{ strObj = AC_RunFlContentX( 'height',height,'swliveconnect','true','src',url,'scale','noborder','id',vokiName,'width',width,'bgcolor','#'+bgcolor,'quality','high','movie',url,'name',vokiEmbedName,'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashVersion+',0,0,0', 'allowScriptAccess', 'always', 'wmode','transparent' ); } if(returnFlagPage==1){ return strObj; } } function AC_Voki_Embed_dbg (width, height, chsm, sc, transparent, bgcolor, returnFlag) { if(returnFlag == undefined) returnFlag = 1; objWidth = width; objHeight = height; tokenString = '&token=0a45cef5c320e2560c4e50cae35abd6d'; justEdited = false; if(window.checkUncachedVoki){ justEdited = checkUncachedVoki(sc); } NotAccelServer = 'http://vhss.oddcast.com'; AccelServer = 'http://vhss-d.oddcast.com'; getVoki = escape((justEdited?NotAccelServer:AccelServer)+'/php/vhss_editors/getvokiV2/chsm='+chsm+'&sc='+sc+(justEdited?'&edited=1':'')+'?r='+parseInt(Math.random()*10000000)); url = 'http://vhss-d.oddcast.com/vhss_editors/voki_player.swf?js=1&doc='+getVoki; showURL = url; flashVersion = 6; returnFlagPage = returnFlag; onPagePlayBackSceneId = sc; if (transparent != 1){ strObj = AC_RunFlContentX( 'height',height,'swliveconnect','true','src',url,'scale','noborder','id','VoKi','width',width,'bgcolor','#'+bgcolor,'quality','high','movie',url,'name','VoKi','codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashVersion+',0,0,0', 'allowScriptAccess', 'always'); }else{ strObj = AC_RunFlContentX( 'height',height,'swliveconnect','true','src',url,'scale','noborder','id','VoKi','width',width,'bgcolor','#'+bgcolor,'quality','high','movie',url,'name','VoKi','codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashVersion+',0,0,0', 'allowScriptAccess', 'always', 'wmode','transparent' ); } if(returnFlagPage==1){ return strObj; } } function launchEditorInComment(playBackSceneId){ if(playBackSceneId == undefined) playBackSceneId = onPagePlayBackSceneId; editorComment = window.open( "http://www.voki.com/vokiCommentEditor.php?sc="+playBackSceneId,"editorComment","width=582,height=540,toolbar=no,resizable=yes,scrollbars=yes"); editorComment.focus(); } function sendVokiToPhone(accId, scId, chsm, pid){ sendToMobileComment = window.open( "http://vhss.oddcast.com/vhss_editors/sendVokiToPhone.php?acc="+accId+'&sc='+scId+'&chsm='+chsm+'&pid='+pid,"sendToMobileComment","width=730,height=625,toolbar=no,resizable=yes,scrollbars=yes"); sendToMobileComment.focus(); } function AC_RunFlContentX(){ var codebase = AC_GetCodebase ( "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" , "7,0,0,0", arguments ); strObj = AC_GenerateObj ( "AC_RunFlContentX()", true, "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" , codebase , "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" , "application/x-shockwave-flash", arguments); if(returnFlagPage==1){ return strObj; } } var MSG_EvenArgs = 'The %s function requires an even number of arguments.' + '\nArguments should be in the form "atttributeName","attributeValue",...'; var MSG_SrcRequired = "The %s function requires that a movie src be passed in as one of the arguments."; function AC_GetCodebase(baseURL, defaultVersion, args){ var codebase = baseURL + defaultVersion; for (var i=0; i < args.length; i=i+2) { currArg = args[i].toLowerCase(); if (currArg == "codebase" && args.length > i+1) { if (args[i+1].indexOf("http://") == 0) { codebase = args[i+1]; }else{ codebase = baseURL + args[i+1]; } } } return codebase; } function AC_sprintf(str){ for (var i=1; i < arguments.length; i++){ str = str.replace(/%s/,arguments[i]); } return str; } function AC_checkArgs(args,callingFn){ var retVal = true; if (parseFloat(args.length/2) != parseInt(args.length/2)){ alert(sprintf(MSG_EvenArgs,callingFn)); retVal = false; } return retVal; } function AC_GenerateObj(callingFn, useXHTML, classid, codebase, pluginsPage, mimeType, args){ if (!AC_checkArgs(args,callingFn)){ return; } var tagStr = ''; var currArg = ''; var closer = (useXHTML) ? '/>' : '>'; var srcFound = false; var embedStr = '\n"; if(returnFlagPage==1){ return tagStr; }else{ document.write(tagStr); } } var voki_mc; function callExternalInterface(name) { if (setVokiMc(name)) voki_mc.vokiPause(); } function vokiPause(name){ if (setVokiMc(name)) voki_mc.vokiPause(); } function vokiResume(name){ if (setVokiMc(name)) voki_mc.vokiResume(); } function vokiPlay(name){ if (setVokiMc(name)) voki_mc.vokiPlay(); } function vokiStop(name){ if (setVokiMc(name)) voki_mc.vokiStop(); } function vokiSayAudio(in_audio_name,name){ if (setVokiMc(name)) voki_mc.vokiSayAudio(in_audio_name); } function sayText(in_txt, in_voice, in_lang, in_engine, in_fx_type, in_fx_level){ if (setVokiMc(name)) voki_mc.sayText(in_txt, in_voice, in_lang, in_engine, in_fx_type, in_fx_level); } function vokiSetVolume(in_volume,name){ if (setVokiMc(name)) voki_mc.vokiSetVolume(in_volume); } function setGaze(deg, dur, rad, obj_name){ if (setVokiMc(obj_name)) voki_mc.setGaze(deg, dur, rad); } function sayAudio(a_name, obj_name){ if (setVokiMc(obj_name)) voki_mc.sayAudio(a_name); } function stopSpeech(obj_name){ if (setVokiMc(obj_name)) voki_mc.stopSpeech(); } function freezeToggle(obj_name){ if (setVokiMc(obj_name)) voki_mc.freezeToggle(); } function replay(obj_name){ if (setVokiMc(obj_name)) voki_mc.replay(); } function setPlayerVolume(vol, obj_name){ if (setVokiMc(obj_name)) voki_mc.setPlayerVolume(vol); } function setHeadScale(in_width, in_height, obj_name) { if (setVokiMc(obj_name)) voki_mc.setHeadScale(in_width, in_height); } function setBodyScale(in_width, obj_name) { if (setVokiMc(obj_name)) voki_mc.setBodyScale(in_width); } function setVokiMc(name){ if (name) { movieName = name; } else { movieName = 'VoKi'; } //if(voki_mc == null || voki_mc == undefined){ //Commented on 12/12/2013 to fix play presentation voki player bug. /*if (navigator.appName.indexOf("Microsoft") != -1 && window[movieName]) { voki_mc= window[movieName]; return true; }else if(document[movieName]){*/ if(document[movieName]) { voki_mc = document[movieName]; return true; } return false; //} //return true; }