/* Released: 2010-03-31 12:16:36 */

if (!$gJQ)
    var $gJQ = jQuery.noConflict();

$gJQ(document).ready(function () {
    $gJQ('h2.sub-nav-header').css('visibility', 'visible');
    $gJQ('#left-navigation').css('visibility', 'visible');
    var productCache = $gJQ ("[class~='product-comp']");
    var lines = $gJQ(".comparison-action-comp .line").not(".dark-header"); 
    var iCounter = 0;
    $gJQ (lines).empty();
    for(i=0;i<productCache.length;i++){
          $gJQ (productCache[i]).appendTo($gJQ (lines[(parseInt(iCounter/4))]));     
          iCounter++;
     }
    
    try {
    	gAccessoiresPndFilter = new AccessoiresPndFilter();
    } catch(e){}

    var pollSettings = {
    	pollCondition : function() {
    		var result = false;
			try {
				if (window.TomTom.Prices.getBySku) {
					result = true;
				}
			} catch(e) {
				result = false;
			} finally {
				return result;
			}
    	},
    	onSuccess : function() {
			$gJQ("#accessories-pnd-filter").find("select, button").removeAttr("disabled");
			$gJQ("#accessories-pnd-filter").find("button").removeClass("disabled");
    	}
    }
    var GwtPricingWidgetPoller = new Poller(pollSettings);
    GwtPricingWidgetPoller.poll();
    
});
