function launchDemo() {
	window.open("/demo/","demo","height=390,width=620,scrollbars=no,left=0,top=0,resizable=yes,status=no");
}

$(function(){
	$('.popups').easydrag();
});

function btnCloseNewWindow() {
	$('.popups div').css('display', 'none');
	$('#popupShadeOut').css('display', 'none');
}

$(document).ready(function() {
	
	if (jQuery.browser.msie) {
		$('#leftContentBottom div').css('padding-top', '0');
	} else {
		$('#leftContentBottomLeft sup').css('line-height', '0');
	}
		
	$('#button, #headerMenuGetStarted').click(function() {
		if (getCookie('advShip')) {
			window.location = '/advancedshipping/plan-selection/';
		} else {
			window.location = '/registration/';
		}
		return false;
	});

	if (getCookie('advShip')) {
		$('#regLink').attr('href', '/advancedshipping/plan-selection/');
	}

	$('.btnClose').mousedown(function() {
		var url = $(this).attr('href');
		$('.popups div').css('display', 'none');
		$('#popupShadeOut').css('display', 'none');
		if (url)
			document.location = url;
	});

	$('.popupDetails').click(function() {
		$('.popups div#offerDetails').css('display', 'block');
			$('.popups').css('top', '150px');
			$('.popups').css('left', '350px');
			$('.popups').css('width', '334px');
		$('#popupShadeOut').css('display', 'block');
	});

});

var popunder = "/satisfaction/";
var winfeatures = "width=630,height=510,scrollbars=1,resizable=1,toolbar=0,location=1,menubar=0,status=0,directories=0";

function loadSurvey() {
	var exp = new Date();
	exp.setTime(exp.getTime() + 62208000000);
	if (getCookie("popunder") == null) {  
		loadpopunder();
		setCookie("popunder", "yes", exp, "/", false, false);
	}
}

function loadpopunder(){
	win2 = window.open(popunder, "", winfeatures);
	if (win2)
		win2.blur();
	window.focus();
}
