/*******************************************
 * This script has a function such that 
 * including it will cause the  alert() function to be overridden
 * with a pop-up window with Sun Country look and feel.
 * You must also include popwin.js if you want to use this
 * You also need to initialize the baseURL by calling setBaseUrl. 
 *******************************************/
var baseURL  = '';

function setBaseUrl(url) {
    baseURL = url;
}

function alert(messages) {
    var popwin = openWin("", 340, 250);
    messages = messages.replace(/\n/g,"<br/>");
    var docHtml = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" + 
       "<html><head><base href='"+baseURL+"'/><title> SCA </title><link rel=\"stylesheet\" href=\"/resources/style.css\"/></head>" + 
       "<body style=\"margin:0px;\">" + 
       "<div><img src=\"/images/popwin/header_new.jpg\" alt=\"suncountry.com go places\" width=\"320\" height=\"50\" border=\"0\"/></div>" +
       "<table cellpadding='5' cellspacing='5' border='0' width='100%' bgcolor='#ffffff'>" +
       "<tr><td>" +
       "<div class=\"popupErrors\">" + 
       "<div><b>Error</b></div>" + "<br><div>" + messages + "</div><br>" +
       "<div align='center'><a href=\"javascript:window.close();\" onmouseover=\"document.closewindow.src='/images/popwin/closewindow_on.gif'\" onmouseout=\"document.closewindow.src='/images/popwin/closewindow_off.gif'\"><img src=\"/images/popwin/closewindow_off.gif\" name=\"closewindow\" width=\"105\" height=\"17\" alt=\"Close Window\" border=\"0\"/></a></div>" +
       "</div>" +
       "</td></tr>" +
       "</table>" +
       "</body></html>";
    popwin.document.writeln(docHtml);
    popwin.document.close();
}

