
// CityAkuten jquery customization


// Function for dynamic city selector
   $(document).ready(function() {
      $('.styleswitch').click(function()
      {
         switchStyle(this.getAttribute("rel"));
		 if (this.getAttribute("href") == '#') {
			return false;
		 } else {
			return true;
		 }
      });
      var c = $.cookie('location');
	  if (c == "" || c == "null" || c == null ) {
		var e=window.document.createElement('script');
		e.setAttribute('src','/js/geolocation.php');
		document.body.appendChild(e);
	  } else {
		switchStyle(c);
	  }
	  
      $('.blockhover').mouseover(function()
      {
         this.setAttribute('className', this.getAttribute('className') + ' hover');
		 this.setAttribute('class', this.getAttribute('class') + ' hover');
      });
	  
      $('.blockhover').mouseout(function()
      {
         this.setAttribute('className', this.getAttribute('className').replace(' hover', ''));
		 this.setAttribute('class', this.getAttribute('class').replace(' hover', ''));
      });
      $('.blockhover').click(function()
      {
		location.href=$(this).find('a:eq(0)').attr('href');
      });
   });

   function switchStyle(styleName)
   {
      $('link[@rel*=style][title]').each(function(i)
      {
         this.disabled = true;
         if (this.getAttribute('title') == styleName) this.disabled = false;
      });
	  $.cookie('location', styleName, { path: '/', expires: 365 });
   }

