function Ventus_OpenWindowAdv(url, name, width, height, resize)
{
	var winpop = window.open(url, name, "width=" + width + ",height=" + height + ",left=" + ((window.screen.availWidth-width)/2) + ",top=" + ((window.screen.availHeight-height)/2) + ",location=0,toolbar=0,status=1,menubar=0,scrollbars=" + resize + ",resizable=" + resize);
	winpop.opener = window;
	winpop.focus();
}

function Ventus_OpenWindow(url, name, width, height)
{
	Ventus_OpenWindowAdv(url, name, width, height, true);
}

function Ventus_SendLink()
{
	var url = "/tools/send_link.aspx?ref=" + self.location;
	Ventus_OpenWindow(url, "Ventus_SendLink", 500, 500);
}

function Ventus_Survey(survey)
{
	var url = "/store/survey/" + survey + ".ashx";
	Ventus_OpenWindowAdv(url, 'Ventus_Survey_' + survey, 510, 490, false);
}

function Ventus_NumbersOnly(input, e)
{
	var key;
	if(window.event)
	{
		key = window.event.keyCode;
	}
	else if(e)
	{
		key = e.which;
	}
	else
	{
		return true;
	}
	return ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27) || (('0123456789').indexOf(String.fromCharCode(key)) > -1));
}

jQuery(function($) {
    $('a[href^="http:"], a[href^="https:"]').click(function() {
        window.open($(this).attr('href'), '_blank');
        return false;
    });

    if ($.browser.safari && !location.href.match(/external/)) {
        $('.sec, .rc').each(function() {
            var col = $(this).parents('.book').length ? '#f5f5f5' : 'white';
            $(this).parent().css('background-color', col);
        });
    }
    
    $('.sec, .rc').corner('3px');
});