 DevicePriceGraphic = {
     dev_id : null,
     period : 1,
     city_id : "minsk",

     form_hash : function(){
         return this.get_city_id()+'&'+this.get_dev_id()+'&'+this.get_period();
     },

     show_graphic : function(){
         window.open("http://graphic.onliner.by/devices_price.html#" + this.form_hash(),"график","width=550,height=350,resizable");
     },
     
     get_dev_id : function(){
         return this.dev_id;
     },

     set_dev_id : function(dev_id){
         this.dev_id=dev_id;
     },

     set_period : function(period){
         this.period=period;
     },
     get_period : function(){
         return this.period;
     },

     get_city_id : function(){
         return this.city_id;
     },

     set_city_id : function(city_id){
         this.city_id=city_id;
     }
}

$(document).ready(
  function()
  {
   $("a.graphic").live('click',function (){

          DevicePriceGraphic.set_dev_id($(this).attr('dev_id'));

          if($(this).attr('period')){
            DevicePriceGraphic.set_period($(this).attr('period'));
          }

          if($(this).attr('city_id')){
              DevicePriceGraphic.set_city_id($(this).attr('city_id'));
          }

          DevicePriceGraphic.show_graphic();
          return false;
   });
}); 








