/// var _Common = function() { this.siteId = null; this.innerPageBG = null; this.getRequestParam = function(requetParamName) { requetParamName = requetParamName.toLowerCase() + "="; var s = window.location.search; s = s.toLowerCase(); var i = s.indexOf(requetParamName) + requetParamName.length; if (i != -1 && i < s.length) { s = s.substr(i); var j = s.indexOf("&"); if (j == -1) j = s.length - 1; s = s.substring(0, j + 1); } else s = null; return s; }; this.getSiteID = function() { if (this.siteId == null) this.siteId = this.getRequestParam("siteid"); return this.siteId; }; this.getUrl = function(sUrl) { if (window.location.href.indexOf("file://")>=0) return "emenufiles/" + sUrl; //for debug else if (window.location.href.indexOf("commondatastorage.googleapis.com")>=0) return "http://commondatastorage.googleapis.com/emenu_smartphones_"+this.siteId+"/emenufiles/" + sUrl.toLowerCase(); //on google server else return "/emenufiles/" + sUrl; //on main server }; this.log=function(s) { console.log(s); if (false) alert(s); }; // // // this.getInnerPageBG = function() // { // if (this.innerPageBG==null) // { // this.innerPageBG = new Image(); // this.innerPageBG.src="url("+Common.getUrl("mobile/sites/" + Common.getSiteID() + "/data/innerPageBg.jpg")+")"; // } // }; }; var Common = new _Common();