jQuery(function ($) {
    $('a[href^=http]').each(function () {
	var $this = $(this);
	var href = $this.attr('href');
	if (href.match(/insightcruises/i)) {
	    // do nothing
//	} else if (href == 'http://www.celebritycruises.com/') {
//	    // do nothing (for the ad)
	} else {
	    href = href.replace(/\#/, '%23');
	    href = href.replace(/\?/, '%3f');
	    var newhref = 'http://insightcruises.com/cgi/go/'+href;
	    // $('<p />').text(newhref).appendTo('body');
	    $this.attr('href', newhref);
	    $this.attr('target', '_blank');
	}
    });
});
window.cgigo = function (url, windowName, windowFeatures) {
    if (url.match(/^http/)) {
	url = url.replace(/\#/, '%23');
	url = url.replace(/\?/, '%3f');
	url = 'http://insightcruises.com/cgi/go/'+url;
    };
    window.open(url, windowName, windowFeatures);
};

