function parseParams(params) {
    var p = params || window.location.search || '',
    	urlParams = {},
    	e,
        a = /\+/g,  // Regex for replacing addition symbol with a space
        r = /([^&=]+)=?([^&]*)/g,
        d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
        q = p.substring(1);
        
    while (e = r.exec(q)) {
       urlParams[d(e[1])] = d(e[2]);
    }
    
    return urlParams;
}

$(document).ready(function(){
	
	Planeffect.Intro.init();
	Planeffect.DragHeader.init('#header-wrap', '#drag-me');
	Planeffect.Bg.init('#cycle_images');
	Planeffect.Product.init();
	Planeffect.Product.listHover();
	Planeffect.Accordion.init();
	
	$('#sub-menu li').not('.active').hover(function(){
		$(this).find('span').stop().animate({width: '100%'}, 400);
	}, function(){
		$(this).find('span').stop().animate({width: '0'}, 250);
	});
	
	$('#tabs').tabs();
	
	if (typeof do_click_id == 'string') {
		$(do_click_id).click();
	}
	
	var $streetview = $('#streetview-planeffect');
	if ($streetview.length) {
		initialize();
	}
	
	$('.addthis_hover').click(function(){
		$(this).next('.addthis_toolbox').toggle();
	});
	
	$('a.sliding').hover(function(){
		var $this = $(this);
		var awidth = $this.width() + ($this.hasClass('menusliding') ? 8 : 14);
		$this.find('span').stop().animate({width:awidth}, 400);
	}, function(){
		var $this = $(this);
		$this.find('span').stop().animate({width:0}, 250).hover();
	});
	
	var $brochure = $('#go_brochure');
	if ($brochure.length) {
		window.open($brochure.attr('href'));
	}

	if (typeof(column_fix) != "undefined") {
		$(column_fix).css({marginRight: 0});
	}

	if (typeof window.lte_ie8 != 'undefined') {
		if (typeof window.ie_slides[0] != 'undefined') {
			$.supersized({
				slides  :  ie_slides          
			});
		}
	}

	Shadowbox.init();
});

