home *** CD-ROM | disk | FTP | other *** search
- copyProtection = new Object();
- copyProtection.sites = new Array();
- copyProtection.addSite = function(name, domains, config)
- {
- this.sites.push({name:name,domains:domains,config:config});
- };
- copyProtection.validate = function()
- {
- var _loc3_ = this;
- var valid = false;
- var i1 = _url.indexOf("//") + 2;
- _loc3_.protocol = _url.substring(0,i1);
- trace("protocol: " + _loc3_.protocol);
- if(_loc3_.protocol eq "file://")
- {
- _loc3_.domain = "file:" + _url.substr(i1).split("/").pop();
- _loc3_.domainWildcard = "file:*";
- }
- else
- {
- var a = _url.substring(i1,i1 + _url.substr(i1,_url.length).indexOf("/")).split(".");
- _loc3_.domain = a[a.length - 2] + "." + a[a.length - 1];
- _loc3_.domainWildcard = a[a.length - 2] + ".*";
- }
- var i = 0;
- while(i < _loc3_.sites.length)
- {
- var _loc2_ = _loc3_.sites[i];
- var _loc1_ = 0;
- while(_loc1_ < _loc2_.domains.length)
- {
- if(_loc3_.domain eq _loc2_.domains[_loc1_] || _loc3_.domainWildcard eq _loc2_.domains[_loc1_])
- {
- valid = true;
- _loc3_.site = _loc2_;
- break;
- }
- _loc1_ = _loc1_ + 1;
- }
- if(valid)
- {
- break;
- }
- i++;
- }
- _loc3_.valid = valid;
- trace("valid: " + _loc3_.valid);
- return _loc3_.valid;
- };
- copyProtection.addSite("miniclip",new Array("miniclip.*","file:*"),{moreGamesUrl:"http://www.miniclip.com",highscoresUrl:"http://www.neodelight.com/index.php?topic=scores&game=" + _root.game,branding:"miniclip"});
- if(copyProtection.validate())
- {
- fullVersion = true;
- }
- else
- {
- getUrl("/", "_top");
- fullVersion = false;
- }
-