function status_alert(alertCookieName, alertId){

  //alert(alertCookieName+"  "+alertId)

  var newCookie = true;

  var base = new Date(0)

  dateAdjustment = base.getTime()

  var expDate = new Date()

  var expToday = new Date()

  var dateInSecs = expDate.getTime()

 // var sixHrsFromNow = (6 * 60 * 60 * 1000) + dateInSecs - (2 * dateAdjustment)

  //var oneWeekFromNow = (7 * 24 * 60 * 60 * 1000) + dateInSecs - (2 * dateAdjustment)

  var fourWeeksFromNow = (28 * 24 * 60 * 60 * 1000) + dateInSecs - (2 * dateAdjustment)

  var now = -1;

//  expDate.setTime(sixHrsFromNow);

  expDate.setTime(fourWeeksFromNow);

  expToday.setTime(now);

  var yellowButton = "images/yellow_light_button.gif";

  var alertButton = "images/red_alert_button.gif";

  CookieArray = document.cookie.split(";");

  for(i=0; i < CookieArray.length; i++){



    var thisStr = (CookieArray[i].split("=")[0]);

    if(thisStr.indexOf(alertCookieName)>-1){ //if(thisStr.indexOf("alertCookieName1")>-1){

      if(CookieArray[i].split("=")[1] == alertId){

        document.write("<img src='images/en/yellow_light_button.gif' width='100' height='40' >");

        newCookie = false;

      }else{

        document.write("<img src='images/en/red_alert_button.gif' width='100' height='40' >");

        newCookie = false;

      }

    }

  }

  if(newCookie){

    document.write("<img src='images/en/red_alert_button.gif' width='100' height='40' >");

  }

  document.cookie = alertCookieName + "=" + alertId +";expires=" + expDate.toGMTString();





}



function spawnWindow(style,w,h,doc,name) {

  if (style == 'stripped') {

     st = ',scrollbars=no,toolbars=no,status=no,menubar=no,location=no'

  }

  else if (style == 'scrolling-stripped') {

     st = ',scrollbars=yes,toolbars=no,status=no,menubar=no,location=no'

  }

  else if (style == 'full') {

     st = ',scrollbars=yes,toolbar=yes,status=yes,menubar=yes,location=yes'

  }

  //alert(name+' = window.open(\''+doc+'\',\''+name+'\',\'width='+w+',height='+h+st+'\')');

  eval(name+' = window.open(\''+doc+'\',\''+name+'\',\'width='+w+',height='+h+st+'\')');

}

function setAction(actionPath){

	document.forms[0].action = actionPath;

//alert(actionPath);

}

function goPreview(){

  //alert(document.forms[0].elements["Preview"].value);

    setAction("/helpadmin/statusPreview.jsp");

    document.forms[0].submit();



}
