var Biglion = {
   'slogan' : 'BIGLION. Сила коллективных покупок',
   'mission' : 'Скидки от 50 до 90% в&nbsp;кафе, рестораны, салоны&nbsp;красоты, SPA, боулинг, театр, кино и&nbsp;др.',

   'defaults' : {/**@see this.resetDefaults() */},

   'dealoffer' : {"chelyabinsk":{"CITY_ID":"20","CITY_NAME":"\u0427\u0435\u043b\u044f\u0431\u0438\u043d\u0441\u043a","CITY_SYSTEM_NAME":"chelyabinsk","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 90% \u043d\u0430 \u0431\u0438\u043b\u0435\u0442 \u0432 \u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440 \u041a\u0438\u043d\u043e\u043c\u0430\u043a\u0441 (\u0432\u0441\u0435\u0433\u043e \u0437\u0430 25 \u0440\u0443\u0431.)","TITLE_LINK":"kinomaxch-90","IMAGE_BIG":"\/general\/upload\/kinomax_big[3].jpg","IMAGE_SMALL":"\/general\/upload\/kinomax_small[3].jpg"},"ekaterinburg":{"CITY_ID":"11","CITY_NAME":"\u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0431\u0443\u0440\u0433","CITY_SYSTEM_NAME":"ekaterinburg","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 55% \u043d\u0430 \u0443\u0441\u043b\u0443\u0433\u0438 \u0441\u0430\u043b\u043e\u043d\u0430 \u043a\u0440\u0430\u0441\u043e\u0442\u044b Fashion Style (\u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u0435 270 \u0440\u0443\u0431. \u0432\u043c\u0435\u0441\u0442\u043e 600 \u0440\u0443\u0431.)","TITLE_LINK":"fstyle-55","IMAGE_BIG":"\/general\/upload\/fstyle_big.jpg","IMAGE_SMALL":"\/general\/upload\/fstyle_small.jpg"},"kazan":{"CITY_ID":"12","CITY_NAME":"\u041a\u0430\u0437\u0430\u043d\u044c","CITY_SYSTEM_NAME":"kazan","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 55% \u043d\u0430 \u0434\u0430\u0439\u0432\u0438\u043d\u0433-weekend \u043d\u0430 \u043e\u0437\u0435\u0440\u0435 \u0413\u043e\u043b\u0443\u0431\u043e\u0435 (\u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u0435 1516 \u0440\u0443\u0431. \u0432\u043c\u0435\u0441\u0442\u043e 3370 \u0440\u0443\u0431.)","TITLE_LINK":"bpearl-55","IMAGE_BIG":"\/general\/upload\/bpearl_big[1].jpg","IMAGE_SMALL":"\/general\/upload\/bpearl_small[1].jpg"},"kiev":{"CITY_ID":"22","CITY_NAME":"\u041a\u0438\u0435\u0432","CITY_SYSTEM_NAME":"kiev","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 52% \u043d\u0430 \u043e\u0434\u0438\u043d \u0437\u0430\u0435\u0437\u0434 \u0432 Forza Karting Kiev (\u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u0435 48 \u0433\u0440\u043d. \u0432\u043c\u0435\u0441\u0442\u043e 100 \u0433\u0440\u043d.)","TITLE_LINK":"forzakiev-52","IMAGE_BIG":"\/general\/upload\/forzakiev_big.jpg","IMAGE_SMALL":"\/general\/upload\/forzakiev_small.jpg"},"krasnoyarsk":{"CITY_ID":"7","CITY_NAME":"\u041a\u0440\u0430\u0441\u043d\u043e\u044f\u0440\u0441\u043a","CITY_SYSTEM_NAME":"krasnoyarsk","CITY_TIMEZONE":"3","hasDealOffer":"0","TITLE":null,"TITLE_LINK":null,"IMAGE_BIG":null,"IMAGE_SMALL":null},"moscow":{"CITY_ID":"1","CITY_NAME":"\u041c\u043e\u0441\u043a\u0432\u0430","CITY_SYSTEM_NAME":"moscow","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 69% \u043d\u0430 \u043c\u043e\u0439\u043a\u0443 \u0438 \u0447\u0438\u0441\u0442\u043a\u0443 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u0432 \u0446\u0435\u043d\u0442\u0440\u0430\u0445 \u0410\u0432\u0442\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0442 (\u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u0435 201 \u0440\u0443\u0431. \u0432\u043c\u0435\u0441\u0442\u043e 650 \u0440\u0443\u0431.)","TITLE_LINK":"autoexpert-69","IMAGE_BIG":"\/general\/upload\/autoexpert_big.jpg","IMAGE_SMALL":"\/general\/upload\/autoexpert_small.jpg"},"nnovgorod":{"CITY_ID":"13","CITY_NAME":"\u041d\u0438\u0436\u043d\u0438\u0439 \u041d\u043e\u0432\u0433\u043e\u0440\u043e\u0434","CITY_SYSTEM_NAME":"nnovgorod","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 90% \u043d\u0430 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u0443\u0441\u043b\u0443\u0433 \u0432 \u0441\u0442\u043e\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043b\u0438\u043d\u0438\u043a\u0435 \u0418\u043c\u043f\u043b\u0430\u043d\u0442.\u0440\u0443 (\u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u0435 400 \u0440\u0443\u0431. \u0432\u043c\u0435\u0441\u0442\u043e 4000 \u0440\u0443\u0431.)","TITLE_LINK":"implant-90","IMAGE_BIG":"\/general\/upload\/implant_big[1].jpg","IMAGE_SMALL":"\/general\/upload\/implant_small[1].jpg"},"novosibirsk":{"CITY_ID":"14","CITY_NAME":"\u041d\u043e\u0432\u043e\u0441\u0438\u0431\u0438\u0440\u0441\u043a","CITY_SYSTEM_NAME":"novosibirsk","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 70% \u043d\u0430 \u0432\u0441\u0435 \u0443\u0441\u043b\u0443\u0433\u0438 \u0432 SPA-\u0441\u0430\u043b\u043e\u043d\u0435 \u0421aprice (\u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u0435 300 \u0440\u0443\u0431. \u0432\u043c\u0435\u0441\u0442\u043e 1000 \u0440\u0443\u0431.)","TITLE_LINK":"caprice-70","IMAGE_BIG":"\/general\/upload\/caprice_big.jpg","IMAGE_SMALL":"\/general\/upload\/caprice_small.jpg"},"omsk":{"CITY_ID":"15","CITY_NAME":"\u041e\u043c\u0441\u043a","CITY_SYSTEM_NAME":"omsk","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 90% \u043d\u0430 \u0431\u0438\u043b\u0435\u0442 \u0432 \u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440 \u0412\u0430\u0432\u0438\u043b\u043e\u043d (\u0432\u0441\u0435\u0433\u043e \u0437\u0430 25 \u0440\u0443\u0431.)","TITLE_LINK":"vavilon-90","IMAGE_BIG":"\/general\/upload\/vavilon_big.jpg","IMAGE_SMALL":"\/general\/upload\/vavilon_small.jpg"},"perm":{"CITY_ID":"16","CITY_NAME":"\u041f\u0435\u0440\u043c\u044c","CITY_SYSTEM_NAME":"perm","CITY_TIMEZONE":"3","hasDealOffer":"0","TITLE":null,"TITLE_LINK":null,"IMAGE_BIG":null,"IMAGE_SMALL":null},"rostovnadonu":{"CITY_ID":"21","CITY_NAME":"\u0420\u043e\u0441\u0442\u043e\u0432-\u043d\u0430-\u0414\u043e\u043d\u0443","CITY_SYSTEM_NAME":"rostovnadonu","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 90% \u043d\u0430 \u0431\u0438\u043b\u0435\u0442 \u0432 \u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440 \u041a\u0438\u043d\u043e\u043c\u0430\u043a\u0441 (\u0432\u0441\u0435\u0433\u043e \u0437\u0430 25 \u0440\u0443\u0431.)","TITLE_LINK":"kinomaxr-90","IMAGE_BIG":"\/general\/upload\/kinomax_big[4].jpg","IMAGE_SMALL":"\/general\/upload\/kinomax_small[4].jpg"},"samara":{"CITY_ID":"17","CITY_NAME":"\u0421\u0430\u043c\u0430\u0440\u0430","CITY_SYSTEM_NAME":"samara","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 90% \u043d\u0430 \u0431\u0438\u043b\u0435\u0442 \u0432 \u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440 5 \u0417\u0432\u0435\u0437\u0434 (\u0432\u0441\u0435\u0433\u043e \u0437\u0430 25 \u0440\u0443\u0431.)","TITLE_LINK":"5zvezd-90","IMAGE_BIG":"\/general\/upload\/5zvezd_big.jpg","IMAGE_SMALL":"\/general\/upload\/5zvezd_small.jpg"},"speterburg":{"CITY_ID":"18","CITY_NAME":"\u0421\u0430\u043d\u043a\u0442-\u041f\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433","CITY_SYSTEM_NAME":"speterburg","CITY_TIMEZONE":"3","hasDealOffer":"1","TITLE":"\u0421\u043a\u0438\u0434\u043a\u0430 80% \u0432 \u0440\u0430\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0446\u0435\u043d\u0442\u0440\u0435 GAME ZONA  (\u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u0435 400 \u0440\u0443\u0431. \u0432\u043c\u0435\u0441\u0442\u043e 2000 \u0440\u0443\u0431.)","TITLE_LINK":"gamezona-80","IMAGE_BIG":"\/general\/upload\/gamezona_big.jpg","IMAGE_SMALL":"\/general\/upload\/gamezona_small.jpg"},"ufa":{"CITY_ID":"19","CITY_NAME":"\u0423\u0444\u0430","CITY_SYSTEM_NAME":"ufa","CITY_TIMEZONE":"3","hasDealOffer":"0","TITLE":null,"TITLE_LINK":null,"IMAGE_BIG":null,"IMAGE_SMALL":null},"volgograd":{"CITY_ID":"10","CITY_NAME":"\u0412\u043e\u043b\u0433\u043e\u0433\u0440\u0430\u0434","CITY_SYSTEM_NAME":"volgograd","CITY_TIMEZONE":"3","hasDealOffer":"0","TITLE":null,"TITLE_LINK":null,"IMAGE_BIG":null,"IMAGE_SMALL":null},"__host":"http:\/\/www.biglion.ru"},

   'resetDefaults': function() {
      this.defaults.host = 'http:\/\/www.biglion.ru';
      this.defaults.source = '\/general\/js\/partnership.js.php?utm_source=p';
      this.defaults.city = 'moscow';
      this.defaults.icon = '\/general\/img\/biglion.jpg';
      this.defaults.text = this.mission;
      this.defaults.title = this.slogan;
   },

   'exportJavascript': function(which, city, clientid) {
      src = '<script type="text\/javascript" src="'+this.defaults.host+this.defaults.source+'"><\/script>\n'
         + '<script type="text\/javascript">if(Biglion&&Biglion.';
      switch(which) {
         case 'textlink':
            src += 'getTextLink){document.write(Biglion.getTextLink("'+city+'", "'+clientid+'"));}';
         break;
         case 'banner400x120':
            src += 'getBanner400x120){document.write(Biglion.getBanner400x120("'+city+'", "'+clientid+'"));}';
         break;
         case 'banner180x250':
            src += 'getBanner180x250){document.write(Biglion.getBanner180x250("'+city+'", "'+clientid+'"));}';
         break;
      }
      src +='<\/script>';
      return src;
   },

	'getGeneralPath': function() {
		url = this.dealoffer.__host ? this.dealoffer.__host : this.defaults.host;
 		url += '\/general\/img\/';
		return url;
	},

   'getUrl': function(city, clientid){
      url = this.dealoffer.__host ? this.dealoffer.__host : this.defaults.host;
      url += city != '' ? ('\/' + (this.dealoffer[city] ? this.dealoffer[city].CITY_SYSTEM_NAME : this.defaults.city) + '\/') : '\/';
      url += '?utm_campaign=PartnerReferral&utm_medium=site&utm_source=p'+clientid;
      return url;
   },

   'getIcon': function(city) {
      icon =  this.dealoffer.__host ? this.dealoffer.__host : this.defaults.host;
      icon += city != '' && this.dealoffer[city] && this.dealoffer[city].hasDealOffer > 0 ? this.dealoffer[city].IMAGE_SMALL : this.defaults.icon;
      return icon;
   },

   'getTextLink': function(city, clientid, noclick) {
      if (!noclick) noclick = false;
      inner = city != '' && this.dealoffer[city] && this.dealoffer[city].hasDealOffer > 0 ? this.dealoffer[city].TITLE : 'Biglion.ru - ' + this.defaults.text;
      attr = city != '' && this.dealoffer[city] && this.dealoffer[city].hasDealOffer > 0 ? this.dealoffer[city].TITLE : this.defaults.title;
      url = this.getUrl(city, clientid);
      return '<a href="'+url+'" title="'+attr+'"'+(noclick?' onclick="return false;"':'')+'>'+inner+'<\/a>';
   },

   'getBanner400x120' : function(city, clientid, noclick) {
      if (!noclick) noclick = false;
      url = this.getUrl(city, clientid);
      inner = city != '' && this.dealoffer[city] && this.dealoffer[city].hasDealOffer > 0 ? this.dealoffer[city].TITLE : this.defaults.text;
      icon = this.getIcon(city);
      icon_alt = city != '' && this.dealoffer[city] && this.dealoffer[city].hasDealOffer > 0 ? this.dealoffer[city].TITLE : this.defaults.title;
      html = '<a href="'+url+'"'+(noclick?' onclick="return false;"':'')+' title="'+icon_alt+'" style="display:block;width:400px;height:120px;line-height:19px;overflow:hidden;background:#93B325 url(\'' + this.getGeneralPath() + 'partner_banners\/bg_400x120.png\');text-decoration:none;font-family:Arial,\'Trebuchet MS\';font-size:19px;color:#FFF;">'
            +'<span style="display:block;padding:3px 5px 0 11px;">'
               +'<span style="display:block;height:94px;overflow:hidden;float:left;margin:8px 22px 33px 0;">'
                  +'<img src="'+icon+'" alt="'+icon_alt+'" style="width:158px; border:0;">'
               +'<\/span>'
               +'<span style="display:block;height:76px;overflow:hidden;">'
	               +inner
               +'<\/span>'
               +'<b style="display:block;line-height:24px;font-size:24px;color:#FFF;margin:6px 0 0 10px;">&nbsp;<img src="' + this.getGeneralPath() + 'partner_banners\/url_biglion.gif" alt="Biglion.ru" title="" border="0"><\/b>'
            +'<\/span>'
            +'<\/a>';
      return html;
   },

   'getBanner180x250': function(city, clientid, noclick){
      if (!noclick) noclick = false;
      url = this.getUrl(city, clientid);
      inner = city != '' && this.dealoffer[city] && this.dealoffer[city].hasDealOffer > 0 ? this.dealoffer[city].TITLE : this.defaults.text;
      icon = this.getIcon(city);
      icon_alt = city != '' && this.dealoffer[city] && this.dealoffer[city].hasDealOffer > 0 ? this.dealoffer[city].TITLE : this.defaults.title;
      html = '<a href="'+url+'"'+(noclick?' onclick="return false;"':'')+' title="'+icon_alt+'" style="display:block;width:180px;height:250px;line-height:19px;overflow:hidden;background:#93B325 url(\'' + this.getGeneralPath() + 'partner_banners\/bg_180x250.png\');text-decoration:none;font-family:Arial,\'Trebuchet MS\';font-size:19px;color:#FFF;">'
            +'<span style="display:block;padding:11px 11px 0;">'
               +'<span style="display:block;height:94px;overflow:hidden;margin-bottom:12px;">'
                  +'<img src="'+icon+'" alt="'+icon_alt+'" style="width:158px; border:0;">'
               +'<\/span>'
               +'<span style="display:block;height:95px;overflow:hidden;margin-bottom:13px;">'
                  +inner
               +'<\/span>'
               +'<b style="display:block;line-height:24px;font-size:24px;color:#FFF;margin:6px 0 0 25px;"><img src="' + this.getGeneralPath() + 'partner_banners\/url_biglion.gif" alt="Biglion.ru" title="" border="0"><\/b>'
            +'<\/span>'
            +'<\/a>';
      return html;
   }
}

Biglion.resetDefaults();
