/** * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ 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){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"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(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},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[_16.length]=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");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_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{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}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(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; var ZY = {}; // public: ZY.g = {}; // private: ZY._g = {}; ZY.Error = { die: function(msg) { //kill script var die = variable_that_doesnt_exist; }, log: function(msg) { if(window.console && window.console.log && typeof(window.console.log=='function')) { window.console.log(msg); } } }; ZY.Debug = { varDump: function(data, addwhitespace, safety, level) { if(addwhitespace==null) addwhitespace = true; //add newlines by default var rtrn = ''; var dt,it,spaces = ''; if(!level) {level = 1;} for(var i=0; i/g,'>'); dt = dt.replace(//g,'>'); dt = dt.replace(/"); }//end if addwhitespace == html return dt; }//end if typeof != object && != array for (var x in data) { if(safety && (level > safety)) { dt = '*RECURSION*'; } else { try { dt = ZY.Debug.varDump(data[x],addwhitespace,safety,level+1); } catch (e) {continue;} }//end if-else level > safety it = ZY.Debug.varDump(x,addwhitespace,safety,level+1); rtrn += it + ':' + dt + ','; if(addwhitespace) { rtrn += '\n'+spaces; }//end if addwhitespace }//end for...in if(addwhitespace) { rtrn = '{\n' + spaces + rtrn.substr(0,rtrn.length-(2+(level*3))) + '\n' + spaces.substr(0,spaces.length-3) + '}'; } else { rtrn = '{' + rtrn.substr(0,rtrn.length-1) + '}'; }//end if-else addwhitespace if(addwhitespace == 'html') { rtrn = rtrn.replace(/ /g," ").replace(/\n/g,"
"); }//end if addwhitespace == html return rtrn; }, copyMe: function(obj, safety_level) { var dump = ''; if(safety_level) { dump = ZY.Debug.varDump(obj, true, safety_level); } else { dump = ZY.Debug.varDump(obj, true, 5); } prompt('copy me!', dump); } }; function $(id) { return document.getElementById(id); } function $node(nodeName) { return document.createElement(nodeName); } function $text(text) { return document.createTextNode(text); } function $get(key) { var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); var results = regex.exec(window.location.href); return (results==null?null:ZY.Util.unescape(results[1])); } ZY.Util = { escape: function(str) { return encodeURIComponent(str); }, unescape: function(str) { return decodeURIComponent(str); }, clearNode: function(node) { if(typeof(node)=='string') node = $(node); if(node.hasChildNodes()) { while(node.childNodes.length>=1) { node.removeChild(node.firstChild); } } }, isArray: function(obj) { return obj && typeof(obj)=='object' && obj.constructor && obj.constructor.toString().indexOf('Array')!=-1; }, isArrayMember: function(array, member) { if(!array) return; for(var i=0; i]*>([\\S\\s]*?)<\/script>', 'img'); }, strip: function(str) { return str.replace(ZY.Util.Scripts.getRegExp(), ''); }, extract: function(str) { return str.match(ZY.Util.Scripts.getRegExp()) || []; }, eval: function(str, appendTo) { var scriptTags = ZY.Util.Scripts.extract(str); for(var i=0; i]*src="([^"]*)"/i.exec(scriptTag); if(srcMatches && srcMatches[1]) { // append it if we get it var scriptNode = $node('script'); appendTo.appendChild(scriptNode); scriptNode.setAttribute('src', srcMatches[1]); } else { // else eval the script text try { eval(ZY.Util.Scripts.getRegExp().exec(scriptTag)[1]); } catch(ex) { ZY.Error.log("ZY.Util.Scripts.eval() - exception with message '"+ex+"'"); } } } return ZY.Util.Scripts.strip(str); } }, getFormValues: function(form) { if(typeof(form)=='string') form = $(form); var values = {}; for(var i=0; i 10 && body.slice(0,9) == '([^<]*)<\/cn_sig>/.exec(response_body); if(!matches || !matches.length || matches.length<2) return false; self._sig = matches[1]; // attempt comm through node var request = ZY.Ajax._createRequest(self._check_path, ZY.Ajax.Method.GET, null, self._initCB3, ZY.Ajax.Transport.Method.FLASH); ZY.Ajax._send(request); }, _initCB3: function(response_body) { var self = ZY.Ajax.Transport.Flash; // flip transport method ZY.Ajax.setTransportMethod(ZY.Ajax.Transport.Method.FLASH); self._setting_up = false; self._setup = true; }, get: function(request_id, url, query) { var self = ZY.Ajax.Transport.Flash; if(!query) query = {}; query['zy_cn_sig'] = self._sig; query['zy_viewer_id'] = ZY.View.viewer_id; url = ZY.Util.prepUrlForQuery(ZY.Util.getAbsoluteUrl(url, ZY.BASE_URL)) + ZY.Util.arrayToQuery(query); var swf = $('ZY_FlashComm'); if(!swf || !swf.sendhttpCall) { ZY.Error.log("ZY.Ajax.Transport.Flash.get() - can't connect to swf"); return false; } swf.sendhttpCall(request_id, url); return true; }, post: function(request_id, url, query) { var self = ZY.Ajax.Transport.Flash; if(!query) query = {}; query['zy_cn_sig'] = self._sig; query['zy_viewer_id'] = ZY.View.viewer_id; //change this to send query data url = ZY.Util.prepUrlForQuery(ZY.Util.getAbsoluteUrl(url, ZY.BASE_URL)) + ZY.Util.arrayToQuery(query); var swf = $('ZY_FlashComm'); var method = 'post' ; if(!swf || !swf.sendhttpCall) { ZY.Error.log("ZY.Ajax.Transport.Flash.post() - can't connect to swf"); return false; } swf.sendhttpCall(request_id, url, method ,query); return true; }, _recieve: function(request_id, body) { var self = ZY.Ajax.Transport.Flash; var response = new ZY.Ajax.Response(request_id, body); ZY.Ajax._recieve(response); return true; } } }; ZY.View = { _enabled: true, _setup: null, _indexPath: null, _path: null, _require: null, _moduleLevelSetup: null, viewer_id: 0, owner_id: 0, _viewer: null, _viewerFriends: null, _viewerFriendIds: null, _people: {}, _navParams: null, _isLoading: false, LoadingImage: { _enabled: true, enable: function() { var self = ZY.View.LoadingImage; self._enabled = true; }, disable: function() { var self = ZY.View.LoadingImage; self._enabled = false; }, show: function() { }, hide: function() { } }, // public: navigate: function(path, require) { var localcount = ZY.g.pageLoadCount; ZY.View._isLoading = true; setTimeout(function() { if (ZY.View._isLoading == true && localcount == ZY.g.pageLoadCount) { // $('MainDiv').style.display = 'none'; $('LoadingOverlay').style.display = 'block'; } }, 3000); setTimeout(function() { if (ZY.View._isLoading == true && localcount == ZY.g.pageLoadCount) { $('LoadingRefresh').style.display = 'block'; } }, 5000); $('TopField').focus(); ZY.View._fetch(path, require); }, get: function(path, params, require) { if(params) { path = ZY.Util.prepUrlForQuery(path) + ZY.Util.arrayToQuery(params); } ZY.View._navParams = null; ZY.View.navigate(path, require); }, post: function(path, params, require) { if(params) { ZY.View._navParams = params; } else { ZY.View._navParams = null; } ZY.View.navigate(path, require); }, getPerson: function(id) { return ZY.View._people[id]; }, setSetupFunction: function(f) { ZY.View._setup = f; }, setIndexPath: function(path) { ZY.View._indexPath = path; }, enable: function() { ZY.View._enabled = true; }, disable: function() { ZY.View._enabled = false; }, getViewer: function() { return ZY.View._viewer; }, getViewerFriends: function() { return ZY.View._viewerFriends; }, getViewerFriendIds: function() { return ZY.View._viewerFriendIds; }, setPath: function(path) { ZY.View._path = path; }, setRequire: function(require) { ZY.View._require = require; }, // private: _addPerson: function(person) { ZY.View._people[person.getId()] = person; }, _addPeople: function(people) { if(!people||typeof(people)!='object') { ZY.Error.log('ZY.View.addPeople() - bad people='+people); } else if(ZY.Util.isArray(people)) { for(var i=0; i0 && !ZY.View._people[uid]) { ZY.View.ZYML._uids[uid] = true; hasUids = true; } } } // get all the zyml spans var spans = dom.getElementsByTagName('span'); for(var i=0; i0 && !ZY.View._people[uid]) { ZY.View.ZYML._uids[uid] = true; hasUids = true; } } } // get additional user info if necessary if(ZY.View.ZYML._elements.length>0) { ZY.View.ZYML._render(callback); } else { callback(); } }, _render: function(callback) { // go through the elements and insert data for(var i=0; i