function load(file,target) {
    if (target != '')
        target.window.location.href = file;
    else
        window.location.href = file;
}

function confirmAndJump(text, ifYes, ifNo) {
  if (confirm(text)) {
    if (ifYes) location.href=ifYes;
  } else {
    if (ifNo) location.href=ifNo;
  }
} 

function doPopup(popupURL, popupName, width, height, noscrez) {
    
    var bName=navigator.appName;
    var bVer=parseInt(navigator.appVersion);
    var now = new Date();
    if (!popupName) popupName = "_general_popup";
    if (!width) width = 800;
    if (!height) height = 600;

    if (bName=="Netscape" && bVer<=3) {
      var popup = window.open("", popupName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+width+',height='+height);
    } else {
      var popup = window.open("", popupName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+noscrez+',resizable=1,width='+width+',height='+height);
    }
    if (popupURL) popup.location.href = popupURL;
    popup.focus();
} 


// functions for the story info popup
var inUse = 0;
function detail( text, event, color, wid ){
        var x, y;
        if( event.x ){
                // IE
                x = event.x + document.body.scrollLeft;
        } else {
                // Mozilla
                x = event.pageX;
        }

        if( event.y ){
                // IE
                y = event.y + document.body.scrollTop;
        } else {
                // Mozilla
                y = event.pageY;
        }

        var tmp = document.getElementById( text ).innerHTML;

        var shir = 300;

        if (wid > 0) {
          shir = wid;
        } 

        tmp = tmp.replace( /^[\r\n\t ]*/g, "" );
        tmp = tmp.replace( /\n/g, "<br>" );

        document.getElementById( "detail" ).style.left = x + 15;
        document.getElementById( "detail" ).style.top = y + 15;
        document.getElementById( "detail" ).style.width = shir;
        document.getElementById( "detail" ).style.wordWrap = "normal";
		document.getElementById( "detail" ).style.background = color;
        document.getElementById( "detail" ).style.visibility = "visible";
        document.getElementById( "detail" ).innerHTML = "<table border=0 cellspacing=0 cellpadding=4 " +
                ( color ? " style='background: " + color + ";'" : "" ) +
                "><tr><td class='left_small' style='text-align: left; word-wrap: normal;'>" + tmp + "</td></tr></table>";    
        // document.getElementById( "detail" ).innerHTML = "<p>" + tmp + "</p>";
        inUse = 1;
}

function closeDetail( delay ){
        inUse = 0;
        setTimeout( 'realCloseDetail()', delay );
}

function realCloseDetail(){
        if( inUse == 1 ) return;
        document.getElementById( "detail" ).style.visibility = "hidden";
}
