/* TOC:

- DOM ready init
- Cluetip
- jquery.rating


*************************** */

function pageLoad(sender, args) {
	//acronym tooltips
	initToolTips();
}

// DOM Ready init
$(document).ready(function () {
	if (navigator.userAgent.indexOf("Firefox") != -1 && navigator.userAgent.indexOf("Mac") != -1) $(document.body).addClass("MacFFbug");

	/*temporary fix for validation status until the new markup is fully implemented*/
	if ($(".statusOk > .status").length) {
		$(".statusOk > .status").parent(".statusOk").css({ 'background': 'none', 'padding': '0' });
	}

	$("#more").hide();
	$("#morelink").removeClass("hide");

	/* Equal height for realted Articles */
	equalHeightRelatedArticle();

	popUpCal.regional['no'] = {
		clearText: 'Slett',
		closeText: 'Lukk kalender',
		prevText: '&lt;&lt;',
		nextText: '&gt;&gt;',
		currentText: 'I dag',
		dayNames: ['S&oslash;', 'Ma', 'Ti', 'On', 'To', 'Fr', 'L&oslash;'],
		monthNames: ['Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember'],
		dateFormat: 'DMY-'
	};

	popUpCal.regional['se'] = {
		clearText: 'Radera',
		closeText: 'Stäng kalender',
		prevText: '&lt;&lt;',
		nextText: '&gt;&gt;',
		currentText: 'Idag',
		dayNames: ['S&ouml;', 'M&aring;', 'Ti', 'On', 'To', 'Fr', 'L&ouml;'],
		monthNames: ['Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December'],
		dateFormat: 'DMY-'
	};

	if (typeof $.fn.calendar == "function") {

		$('input.cal').calendar();

		if ($('input.cal').hasClass("lang-no")) {
			popUpCal.setDefaults(popUpCal.regional['no']);
		} else if ($('input.cal').hasClass("lang-se")) {
			popUpCal.setDefaults(popUpCal.regional['se']);
		}
	}

	//Layout fix for IE6 when module content is too wide to fit the unit...
	if ($.browser.msie && $.browser.version < 7) {
		$(function () {
			$(".unit").each(function () {
				var mods = $(".mod", this);
				mods.hide();
				this.style.width = this.offsetWidth + "px";
				mods.show();
			});
		});
	}

	//Login
	$("#login div.close").click(function () {
		$(this).slideUp(300, function () {
			$("#login div.open").animate({ height: 'show' }, 500, function () { });
		})
		return false;
	});

	// Compare-list: formats the contents and transform the dd's into tooltips (aka clueTips)
	$('#main div.compare dt').each(function (i) {
		$(this).html('<a href="#compare' + i + '" rel="#compare' + i + '" title="' + $(this).text() + '">' + $(this).text() + '</a>')
		.next("dd").attr({ id: 'compare' + i }).hide();
	});

	$('#relatedproducts  dt, .alarmproducts  dt, .alarmcalc dt').each(function (i) {
		var $thisLink = $(this).children("a");
		var thisTitle = $thisLink.children(".title").text() || $thisLink.text();
		$thisLink.attr({ href: '#rel' + i, rel: '#rel' + i, title: thisTitle })
		.parent()
		.next("dd")
		.attr({ id: 'rel' + i })
		.hide();
	});

	$('#relatedproducts dt a, .alarmproducts dt a, .alarmcalc a').cluetip({
		local: true,
		attribute: 'rel',
		arrows: true,
		waitImage: false,
		dropShadow: false,
		width: 300,
		positionBy: 'mouse',
		cluetipClass: 'jtip'
	}
	).click(function () { return false; });
	//).click(function(){alert('clicked'); return false;});


	$('#main div.compare dt a').css("border-bottom", "1px dotted #ccc").cluetip({
		local: true,
		attribute: 'rel',
		hoverClass: 'highlight',
		arrows: true,
		waitImage: false,
		dropShadow: false,
		width: 300,
		positionBy: 'mouse',
		cluetipClass: 'jtip'
	}
	).click(function () { return false; });
	//).click(function(){alert('clicked'); return false;});

	//acronym tooltips
	//initToolTips();

	//product gallery
	$(".productimg").each(function () {
		var _gallery = $(this);
		var _show = $(".large", this);
		var _imgs = $("a", this);
		_imgs.click(function () {
			$(".current", _gallery).removeClass("current");
			$(this).addClass("current");

			//shift image and fade it when loaded.
			$('<img />')
				.load(function () {
					var newImg = $(this);
					_show.fadeTo(300, 0, function () {
						_show.html(newImg).fadeTo(300, 1);
					})

				})
			    .attr('src', this.href);
			/*_show.html($('<img />').attr('src', this.rel))*/
			return false;

		})
			.prepend("<span class='curarrow-dark'></span>");

		$(_imgs[0]).click();
	});

	if (typeof $.fn.tabs == "function" && $("#tabs ul li").length) {
		$("#tabs").tabs();
		$("#tabs ul li").each(function () {
			$(this).append("<span class='curarrow-tabs'></span>");
		});
		$(".tabstcontent").show()
			.find(".c2 input.star").rating({
				focus: function (value, link) {
					var tip = $('#YourRatingText');
					tip[0].data = tip[0].data || tip.html();
					tip.html(link.title || 'value: ' + value);
				},
				blur: function (value, link) {
					var tip = $('#YourRatingText');
					$('#YourRatingText').html(tip[0].data || '');
				}

			});
	}

	// Prevent typing anything else but numbers
	$("input.onlynumbers").keypress(function (e) {
		//if the letter is not digit don't type anything
		if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
			return false;
		}
	});

	if ($("table.sortable:not(.pager)").size() > 0) {
		$("table.sortable:not(.pager)").tablesorter({
			sortList: [[0, 0]],
			widgets: ['zebra'],
			textExtraction: function (node) {
				return node.getAttribute('sortvalue') || node.innerHTML;
			}
		});
	}

	if ($("table.sortable.pager").size() > 0) {
		$("table.sortable.pager")
		.tablesorter({
			widthFixed: true,
			widgets: ['zebra'],
			textExtraction: function (node) {
				return node.getAttribute('sortvalue') || node.innerHTML;
			} 
		})
		.tablesorterPager({ container: $("#pager"), positionFixed: false });
	}

	//FAQ generic setup, with <dl id="faq"><dt><strong>{question}</strong></dt><dd>{<p>answer</p>}</dd></dl>
	$('dl.faq').find('dd').hide().end().find('dt').click(function () {
		var question = $(this);
		var answer = question.next('dd');
		if (answer.is(':visible')) {
			answer.slideUp(100);
			question.removeClass("open");
		} else {
			answer.slideDown(100);
			question.addClass("open");
		}
	});

	//Read more links
	$(".read-more-btn").click(function () {
		el = $(this);
		moreTxt = el.parents().find(".read-more-content").first();

		if (moreTxt.is(":visible")) {
			moreTxt.slideUp();
			el.removeClass("collapse");
		} else {
			moreTxt.slideDown();
			el.addClass("collapse");
		}
		return false;
	});
	$(".pinfobox a.box-head").click(function () {
		$(this).find(".read-more-btn").trigger("click");
		return false;
	});
});       // end DOM Ready init

function equalHeightRelatedArticle(){
	var tallest = 0;
	$(".related-readmore .article").each(function(){
		var thisHeight = $(this).height();

		if(thisHeight > tallest)
			tallest = thisHeight;
	}).height(tallest);
}

// VIDEO: //////////////////////////
// Pause VideoPlayer when clicking on tabs (works best in IE)
// API: community.23video.com/help/en:Developer_Player_JavaScript
function getPlayer(appName) {
	return (navigator.appName.indexOf ("Microsoft") !=-1) ? window[appName] : document[appName];
}

$(window).load(function(){
	$("#tabs a").click(function(e){
		var app = getPlayer("VideoPlayer");
		if(app!=undefined) app.pauseVideo();
	});
});

function initToolTips(containerId) {
	var container;
	if (!containerId) container = document;
	else container = $(containerId);
	$('acronym', container).each(function () {
		var el = $(this);

		if (el.attr("id")) {
			el.attr({ "infotitle": el.text(), "infotext": "#" + el.attr("id").substring(1) });
		} else {
			el.attr({ "infotitle": el.text(), "infotext": el.attr("title"), "title": "" });
		}
		
	}).cluetip({
		local: true,
		attribute: 'infotext',
		titleAttribute: 'infotitle',
		hoverClass: 'highlight',
		arrows: true,
		waitImage: false,
		dropShadow: false,
		width: 400,
		positionBy: 'mouse',
		cluetipClass: 'jtip'
	});
}

// Function for fixing problem with RadioButton.GroupName in a repeater
function SetUniqueRadioButton(nameregex, current) {
	re = new RegExp(nameregex);
	$("input[type='radio']").each(function(i) {
		if (re.test($(this).attr("name"))) {
			this.checked = false;
		}
	});
	current.checked = true;
}


/*
 * jQuery clueTip plugin
 * Version 0.9.0  (09/04/2007)
 * @requires jQuery v1.1.1
 * @requires Dimensions plugin 
 */
(function($) { 
  var $cluetip, $cluetipInner, $cluetipOuter, $cluetipTitle, $dropShadow, imgCount;
  var msie6 = $.browser.msie && ($.browser.version && $.browser.version < 7 || (/5\.5|6.0/).test(navigator.userAgent));

  $.fn.cluetip = function(options) {
    
    // set up default options
    var defaults = {
      width: 275,
      height: 'auto',
      local: false,
      hideLocal: true,
      attribute: 'rel',
      titleAttribute: 'title',
      splitTitle: '',
      showTitle: true,
      cluetipClass: 'default',
      hoverClass: '',
      waitImage: true,
      cursor: 'help',
      arrows: false, 
      dropShadow: true,
      dropShadowSteps: 6,
      sticky: false,
      mouseOutClose: false,
      activation: 'hover',
      closePosition: 'top',
      closeText: 'Close',
      truncate: 0,
      cluezIndex: 97,
      positionBy: 'auto', 
      fx: {
        open: 'show',
        openSpeed: '',
        close: 'hide',
        closeSpeed: ''
      },
      hoverIntent: {
        sensitivity: 3,
  			interval: 50,
  			timeout: 0
      },
      onShow: function (ct, c){},
      ajaxCache: true,  
      ajaxProcess: function(data) {
        data = $(data).not('style, meta, link, script, title');
        return data;
      },
      ajaxSettings: {
        dataType: 'html'
      }
    };
    
    if (options && options.ajaxSettings) {
      $.extend(defaults.ajaxSettings, options.ajaxSettings);
      delete options.ajaxSettings;
    }
    if (options && options.fx) {
      $.extend(defaults.fx, options.fx);
      delete options.fx;
    }
    if (options && options.hoverIntent) {
      $.extend(defaults.hoverIntent, options.hoverIntent);
      delete options.hoverIntent;
    }
    $.extend(defaults, options);
    
    return this.each(function() {
      // start out with no contents (for ajax activation)
      var cluetipContents = false;
      var cluezIndex = parseInt(defaults.cluezIndex, 10)-1;
      var isActive = false;
      
      // create the cluetip divs
      if (!$cluetip) {
        $cluetipInner = $('<div id="cluetip-inner"></div>');
        $cluetipTitle = $('<h3 id="cluetip-title"></h3>');        
        $cluetipOuter = $('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle);
        $cluetip = $('<div></div>').attr({'id': 'cluetip'}).css({zIndex: defaults.cluezIndex})
        .append($cluetipOuter)[insertionType](insertionElement).hide();
        
		//BR
		if(defaults.waitImage)
			$('<div id="cluetip-waitimage"></div>').css({position: 'absolute', zIndex: cluezIndex-1}).insertBefore('#cluetip').hide();
        //--
		$cluetip.css({position: 'absolute', zIndex: cluezIndex});
        $cluetipOuter.css({position: 'relative', zIndex: cluezIndex+1});
      }
      var dropShadowSteps = (defaults.dropShadow) ? +defaults.dropShadowSteps : 0;
      if (!$dropShadow) {
        $dropShadow = $([]);
        for (var i=0; i < dropShadowSteps; i++) {
          $dropShadow = $dropShadow.add($('<div></div>').css({zIndex: cluezIndex-i-1, opacity:.1, top: 1+i, left: 1+i}));
        };
        $dropShadow.css({position: 'absolute', backgroundColor: '#000'})
        .prependTo($cluetip);
      }
      var $this = $(this);      
      var tipAttribute = $this.attr(defaults.attribute), ctClass = defaults.cluetipClass;
      if (!tipAttribute && !defaults.splitTitle) return true;
      // if hideLocal is set to true, on DOM ready hide the local content that will be displayed in the clueTip
      if (defaults.local && defaults.hideLocal) { $(tipAttribute).hide(); }
      // vertical measurement variables
      var tipHeight, wHeight;
      var defHeight = isNaN(parseInt(defaults.height, 10)) ? 'auto' : (/\D/g).test(defaults.height) ? defaults.height : defaults.height + 'px';
      var sTop, linkTop, posY, tipY, mouseY;
      // horizontal measurement variables
      var tipWidth = parseInt(defaults.width, 10) + parseInt($cluetip.css('paddingLeft')) + parseInt($cluetip.css('paddingRight')) + dropShadowSteps;
      if( isNaN(tipWidth) ) tipWidth = 275;
      var linkWidth = this.offsetWidth;
      var linkLeft, posX, tipX, mouseX, winWidth;
            
      // parse the title
      var tipParts;
      var tipTitle = (defaults.attribute != 'title') ? $this.attr(defaults.titleAttribute) : '';
      if (defaults.splitTitle) {
        tipParts = tipTitle.split(defaults.splitTitle);
        tipTitle = tipParts.shift();
      }
      var localContent;


//activate clueTip
    var activate = function(event) {
      isActive = true;
      $cluetip.removeClass().css({width: defaults.width});
      if (tipAttribute == $this.attr('href')) {
        $this.css('cursor', defaults.cursor);
      }
      $this.attr('title','');
      if (defaults.hoverClass) {
        $this.addClass(defaults.hoverClass);
      }
      linkTop = posY = $this.offset().top;
      linkLeft = $this.offset().left;
      mouseX = event.pageX;
      mouseY = event.pageY;
      if ($this[0].tagName.toLowerCase() != 'area') {
        sTop = $(document).scrollTop();
        winWidth = $(window).width();
      }
// position clueTip horizontally
      posX = (linkWidth > linkLeft && linkLeft > tipWidth)
        || linkLeft + linkWidth + tipWidth > winWidth 
        ? linkLeft - tipWidth - 15 
        : linkWidth + linkLeft + 15;
      if ($this[0].tagName.toLowerCase() == 'area' || defaults.positionBy == 'mouse' || linkWidth + tipWidth > winWidth) { // position by mouse
        if (mouseX + 20 + tipWidth > winWidth) {  
          posX = (mouseX - tipWidth - 20) >= 0 ? mouseX - tipWidth - 20 :  mouseX - (tipWidth/2);
        } else {
          posX = mouseX + 20;
        }
        var pY = posX < 0 ? event.pageY + 20 : event.pageY;
      }
      posX < linkLeft ? $cluetip.addClass('clue-left-' + ctClass).removeClass('clue-right-' + ctClass)
      : $cluetip.addClass('clue-right-' + ctClass).removeClass('clue-left-' + ctClass);                
      $cluetip.css({left: (posX > 0 && defaults.positionBy != 'bottomTop') ? posX : (mouseX + (tipWidth/2) > winWidth) ? winWidth/2 - tipWidth/2 : Math.max(mouseX - (tipWidth/2),0)});
      wHeight = $(window).height();

/***************************************
* load the title attribute only (or user-selected attribute). 
* clueTip title is the string before the first delimiter
* subsequent delimiters place clueTip body text on separate lines
***************************************/
      if (tipParts) {
        for (var i=0; i < tipParts.length; i++){
          if (i == 0) {
            $cluetipInner.html(tipParts[i]);
          } else { 
            $cluetipInner.append('<div class="split-body">' + tipParts[i] + '</div>');
          }            
        };
        cluetipShow(pY);
      }
/***************************************
* load external file via ajax          
***************************************/
      else if (!defaults.local && tipAttribute.indexOf('#') != 0) {
        if (cluetipContents && defaults.ajaxCache) {
          $cluetipInner.html(cluetipContents);
          cluetipShow(pY);
        }
        else {
          var ajaxSettings = defaults.ajaxSettings;
          ajaxSettings.url = tipAttribute;
          ajaxSettings.beforeSend = function() {
            $cluetipOuter.children().empty();
            if (defaults.waitImage) {
              $('#cluetip-waitimage')
              .css({top: mouseY-10, left: parseInt(posX+(tipWidth/2),10)})
              .show();
            }
          };
         ajaxSettings.error = function() {
            if (isActive) {
              $cluetipInner.html('<i>sorry, the contents could not be loaded</i>');
            }
          };
          ajaxSettings.success = function(data) {
            cluetipContents = defaults.ajaxProcess(data);
            if (isActive) {
              $cluetipInner.html(cluetipContents);
            }
          };
          ajaxSettings.complete = function() {
          	imgCount = $('#cluetip-inner img').length;
        		if (imgCount) {
        		  $('#cluetip-inner img').load( function(){
          			imgCount--;
          			if (imgCount<1) {
          				$('#cluetip-waitimage').hide();
          			  if (isActive) cluetipShow(pY);
          			}
        		  }); 
        		} else {
      				$('#cluetip-waitimage').hide();
        		  cluetipShow(pY);    
        		} 
          };
          $.ajax(ajaxSettings);
        }

/***************************************
* load an element from the same page
***************************************/
      } else if (defaults.local){
		if(tipAttribute.indexOf('#') == 0){
			//refers to the content of an element on page with set id="" attribute, eg. compare lists
			$tip = $(tipAttribute);
			var localContent = $(tipAttribute).html();
			
			if($tip.hasClass("customtip")){
				$cluetip.addClass($tip.attr("class"));
			}

			$cluetipInner.html(localContent);
			cluetipShow(pY);
		} else {
			//otherwise, show the text of the attribute, eg. <acronym title="here's the text" ... 
			$cluetipInner.html('<p>'+tipAttribute+'</p>');
			cluetipShow(pY);
		}
	  }
    };

// get dimensions and options for cluetip and prepare it to be shown
    var cluetipShow = function(bpY) {
      $cluetip.addClass('cluetip-' + ctClass);
      
      if (defaults.truncate) { 
        var $truncloaded = $cluetipInner.text().slice(0,defaults.truncate) + '...';
        $cluetipInner.html($truncloaded);
      }
      function doNothing() {}; //empty function
      tipTitle ? $cluetipTitle.show().html(tipTitle) : (defaults.showTitle) ? $cluetipTitle.show().html('&nbsp;') : $cluetipTitle.hide();
      if (defaults.sticky) {
        var $closeLink = $('<div id="cluetip-close"><a href="#">' + defaults.closeText + '</a></div>');
        (defaults.closePosition == 'bottom') ? $closeLink.appendTo($cluetipInner) : (defaults.closePosition == 'title') ? $closeLink.prependTo($cluetipTitle) : $closeLink.prependTo($cluetipInner);
        $closeLink.click(function() {
          cluetipClose();
          return false;
        });
        if (defaults.mouseOutClose) {
          $cluetip.hover(function() {doNothing(); }, 
          function() {$closeLink.trigger('click'); });
        } else {
          $cluetip.unbind('mouseout');
        }
      }
// now that content is loaded, finish the positioning 
      $cluetipOuter.css({overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight});
      tipHeight = defHeight == 'auto' ? $cluetip.outerHeight() : parseInt(defHeight,10);   
      tipY = posY;
      if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || defaults.positionBy == 'bottomTop') {
        tipY = posY + tipHeight > sTop + wHeight && mouseY - sTop > tipHeight + 10 ? mouseY - tipHeight - 16 : mouseY + 20;
      } else if ( posY + tipHeight > sTop + wHeight ) {
        tipY = (tipHeight >= wHeight) ? sTop : sTop + wHeight - tipHeight - 10;
      } else if ($this.css('display') == 'block' || $this[0].tagName.toLowerCase() == 'area' || defaults.positionBy == "mouse") {
        tipY = bpY - 10;
      } else {
        tipY = posY - defaults.dropShadowSteps;
      } 
      $cluetip.css({top: tipY + 'px'});
      if (defaults.arrows) { // set up background positioning to align with element
        var bgPos = '0 0';
        var bgY = (posY - tipY - defaults.dropShadowSteps);
        if ($cluetip.is('.clue-left-' + ctClass)) {
          bgPos = posX >=0 ? '100% ' + bgY + 'px' : '100% 0';
        } else if ($cluetip.is('.clue-right-' +ctClass)) {
          bgPos = (posX >=0 && bgY > 0) ? '0 ' + bgY + 'px' : '0 0';
        }        
      } else {
        bgPos = '0 100%';
      }
      $cluetip.css({backgroundPosition: bgPos});

// (first hide, then) ***SHOW THE CLUETIP***
      $dropShadow.hide();
      $cluetip.hide()[defaults.fx.open](defaults.fx.open != 'show' && defaults.fx.openSpeed);
      if (defaults.dropShadow) $dropShadow.css({height: tipHeight, width: defaults.width}).show();
      // trigger the optional onShow function
      defaults.onShow($cluetip, $cluetipInner);
    };

/***************************************
   =INACTIVATION
-------------------------------------- */
    var inactivate = function() {
      isActive = false;
      $('#cluetip-waitimage').hide();
      if (!defaults.sticky) {
        cluetipClose();
      };
      if (defaults.hoverClass) {
        $this.removeClass(defaults.hoverClass);
      }
    };
// close cluetip and reset title attribute if one exists
    var cluetipClose = function() {
      $cluetipOuter 
      .parent()[defaults.fx.close](defaults.fx.closeSpeed).removeClass().end()
      .children().empty();
      if (tipTitle) {
        $this.attr('title', tipTitle);
		$this.attr(defaults.titleAttribute, tipTitle);
      }
    };

/***************************************
   =BIND EVENTS
-------------------------------------- */
  // activate by click
      if (defaults.activation == 'click'||defaults.activation == 'toggle') {
        $this.click(function(event) {
          if ($cluetip.is(':hidden')) {
            activate(event);
          } else {
            inactivate(event);
          }
          this.blur();
          return false;
        });
  // activate by hover
    // clicking is returned false if cluetip url is same as href url
      } else {
        $this.click(function() {
          if (tipAttribute == $this.attr('href')) {
            return false;
          }
        });
        if ($.fn.hoverIntent && defaults.hoverIntent) {
          $this.hoverIntent({
            sensitivity: defaults.hoverIntent.sensitivity,
            interval: defaults.hoverIntent.interval,  
            over: function(event) {activate(event);}, 
            timeout: defaults.hoverIntent.timeout,  
            out: function(event) {inactivate(event);}
          });           
        } else {
          $this.hover(function(event) {
            activate(event);
          }, function(event) {
            inactivate(event);
          });
        }
      }
    });
  };
  
/*
 * Global defaults for clueTips. Apply to all calls to the clueTip plugin.
 */
   
  var insertionType = 'appendTo', insertionElement = 'body';
  $.cluetip = {};
  $.cluetip.setup = function(options) {
    if (options && options.insertionType && (options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)) {
      insertionType = options.insertionType;
    }
    if (options && options.insertionElement) {
      insertionElement = options.insertionElement;
    }
  };
  
  
  
  /*
 ### jQuery Star Rating Plugin v3.12 - 2009-04-16 ###
 * Home: http://www.fyneworks.com/jquery/star-rating/
 * Code: http://code.google.com/p/jquery-star-rating-plugin/
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';5(1O.1t)(7($){5($.29.1x)1I{1m.23("1u",P,z)}1F(e){}$.p.4=7(j){5(3.K==0)l 3;5(E J[0]==\'1j\'){5(3.K>1){8 k=J;l 3.W(7(){$.p.4.H($(3),k)})};$.p.4[J[0]].H(3,$.1T(J).21(1)||[]);l 3};8 j=$.10({},$.p.4.18,j||{});3.1v(\'.9-4-1l\').n(\'9-4-1l\').W(7(){8 a=(3.1J||\'1K-4\').1L(/\\[|\\]+/g,"1S");8 b=$(3.1U||1m.1X);8 c=$(3);8 d=b.6(\'4\')||{y:0};8 e=d[a];8 f;5(e)f=e.6(\'4\');5(e&&f){f.y++}B{f=$.10({},j||{},($.1k?c.1k():($.1H?c.6():s))||{},{y:0,C:[],u:[]});f.t=d.y++;e=$(\'<1M 12="9-4-1Q"/>\');c.1R(e);e.n(\'4-T-13-S\');5(c.R(\'Q\'))f.m=z;e.1a(f.A=$(\'<O 12="4-A"><a 14="\'+f.A+\'">\'+f.15+\'</a></O>\').1d(7(){$(3).4(\'N\');$(3).n(\'9-4-M\')}).1b(7(){$(3).4(\'v\');$(3).D(\'9-4-M\')}).1h(7(){$(3).4(\'w\')}).6(\'4\',f))};8 g=$(\'<O 12="9-4 q-\'+f.t+\'"><a 14="\'+(3.14||3.1p)+\'">\'+3.1p+\'</a></O>\');e.1a(g);5(3.U)g.R(\'U\',3.U);5(3.17)g.n(3.17);5(f.1V)f.x=2;5(E f.x==\'19\'&&f.x>0){8 h=($.p.11?g.11():0)||f.1c;8 i=(f.y%f.x),V=1y.1z(h/f.x);g.11(V).1A(\'a\').1B({\'1C-1D\':\'-\'+(i*V)+\'1E\'})};5(f.m)g.n(\'9-4-1e\');B g.n(\'9-4-1G\').1d(7(){$(3).4(\'1f\');$(3).4(\'G\')}).1b(7(){$(3).4(\'v\');$(3).4(\'F\')}).1h(7(){$(3).4(\'w\')});5(3.L)f.o=g;c.1i();c.1N(7(){$(3).4(\'w\')});g.6(\'4.r\',c.6(\'4.9\',g));f.C[f.C.K]=g[0];f.u[f.u.K]=c[0];f.q=d[a]=e;f.1P=b;c.6(\'4\',f);e.6(\'4\',f);g.6(\'4\',f);b.6(\'4\',d)});$(\'.4-T-13-S\').4(\'v\').D(\'4-T-13-S\');l 3};$.10($.p.4,{G:7(){8 a=3.6(\'4\');5(!a)l 3;5(!a.G)l 3;8 b=$(3).6(\'4.r\')||$(3.Z==\'X\'?3:s);5(a.G)a.G.H(b[0],[b.I(),$(\'a\',b.6(\'4.9\'))[0]])},F:7(){8 a=3.6(\'4\');5(!a)l 3;5(!a.F)l 3;8 b=$(3).6(\'4.r\')||$(3.Z==\'X\'?3:s);5(a.F)a.F.H(b[0],[b.I(),$(\'a\',b.6(\'4.9\'))[0]])},1f:7(){8 a=3.6(\'4\');5(!a)l 3;5(a.m)l;3.4(\'N\');3.1n().1o().Y(\'.q-\'+a.t).n(\'9-4-M\')},N:7(){8 a=3.6(\'4\');5(!a)l 3;5(a.m)l;a.q.1W().Y(\'.q-\'+a.t).D(\'9-4-1q\').D(\'9-4-M\')},v:7(){8 a=3.6(\'4\');5(!a)l 3;3.4(\'N\');5(a.o){a.o.6(\'4.r\').R(\'L\',\'L\');a.o.1n().1o().Y(\'.q-\'+a.t).n(\'9-4-1q\')}B $(a.u).1r(\'L\');a.A[a.m||a.1Y?\'1i\':\'1Z\']();3.20()[a.m?\'n\':\'D\'](\'9-4-1e\')},w:7(a){8 b=3.6(\'4\');5(!b)l 3;5(b.m)l;b.o=s;5(E a!=\'1s\'){5(E a==\'19\')l $(b.C[a]).4(\'w\');5(E a==\'1j\')$.W(b.C,7(){5($(3).6(\'4.r\').I()==a)$(3).4(\'w\')})}B b.o=3[0].Z==\'X\'?3.6(\'4.9\'):(3.22(\'.q-\'+b.t)?3:s);3.6(\'4\',b);3.4(\'v\');8 c=$(b.o?b.o.6(\'4.r\'):s);5(b.1g)b.1g.H(c[0],[c.I(),$(\'a\',b.o)[0]])},m:7(a,b){8 c=3.6(\'4\');5(!c)l 3;c.m=a||a==1s?z:P;5(b)$(c.u).R("Q","Q");B $(c.u).1r("Q");3.6(\'4\',c);3.4(\'v\')},24:7(){3.4(\'m\',z,z)},25:7(){3.4(\'m\',P,P)}});$.p.4.18={A:\'26 27\',15:\'\',x:0,1c:16};$(7(){$(\'r[28=1w].9\').4()})})(1t);',62,134,'|||this|rating|if|data|function|var|star||||||||||||return|readOnly|addClass|current|fn|rater|input|null|serial|inputs|draw|select|split|count|true|cancel|else|stars|removeClass|typeof|blur|focus|apply|val|arguments|length|checked|hover|drain|div|false|disabled|attr|drawn|to|id|spw|each|INPUT|filter|tagName|extend|width|class|be|title|cancelValue||className|options|number|append|mouseout|starWidth|mouseover|readonly|fill|callback|click|hide|string|metadata|applied|document|prevAll|andSelf|value|on|removeAttr|undefined|jQuery|BackgroundImageCache|not|radio|msie|Math|floor|find|css|margin|left|px|catch|live|meta|try|name|unnamed|replace|span|change|window|context|control|before|_|makeArray|form|half|children|body|required|show|siblings|slice|is|execCommand|disable|enable|Cancel|Rating|type|browser'.split('|'),0,{}))
  
})(jQuery);
