// JavaScript Document
//Set the two dates
function checkClosingNotice(year1,month1,day1,year2,month2,day2,forwhat) {
  var date1=new Date(year1, month1, day1); 
  var date2=new Date(year2, month2, day2);
//Calculate difference btw the two dates, and convert to days
  today=new Date();
  var time1 = date1.getTime();
  var time2 = date2.getTime();
  var todaytime = today.getTime();
  if((todaytime >= time1) && (todaytime <= time2)) { 
    document.writeln("<p>");
    document.writeln("<table width=\"400\"  border=\"1\" align=\"center\" cellpadding=\"10\" cellspacing=\"1\" bordercolor=\"#FF0000\">");
    document.writeln("<tr>");
    document.writeln("<td bgcolor=\"#FFFFCC\"><FONT SIZE=\"2\">");
    document.writeln("<p><strong><font color=\"#FF0000\" >Closing notice:</font> </strong>Max-Gain Systems will be closed <b>" + reason + "</b>");
	document.writeln("Please be assured that we will reply to all online orders and inquiries, as well as voice mails, as soon as possible on reopening. </p>");
    document.writeln("<p>Thank you,&nbsp;<br>The MGS Staff </p></FONT></td>");
    document.writeln("</tr>");
    document.writeln("</table>"); 
  }
}
function checkSpecialNotice(s_year1,s_month1,s_day1,s_year2,s_month2,s_day2,s_forwhat) {
  var date1=new Date(s_year1, s_month1, s_day1); 
  var date2=new Date(s_year2, s_month2, s_day2);
//Calculate difference btw the two dates, and convert to days
  today=new Date();
  var time1 = date1.getTime();
  var time2 = date2.getTime();
  var todaytime = today.getTime();
  if((todaytime >= time1) && (todaytime <= time2)) { 
    document.writeln("<p>");
    document.writeln("<table width=\"500\"  border=\"1\" align=\"center\" cellpadding=\"10\" cellspacing=\"1\" bordercolor=\"#FF0000\">");
    document.writeln("<tr>");
    document.writeln("<td bgcolor=\"#FFFFCC\"><FONT SIZE=\"2\">");
    document.writeln("<p><strong><font color=\"#FF0000\">Special notice:</font> </strong><b>" + s_reason + "</b>.");
	document.writeln("<p>Thank you,&nbsp;<br>The MGS Staff </p></FONT></td>");
    document.writeln("</tr>");
    document.writeln("</table>"); 
  }
}

function openNewDisplayWindow(imgfile, title, desc) {
  // create the window
 
  option = "toolbar=0,scrollbars=1,resizable=1,width=700,height=600,status=0,directories=0,location=0";

  displayWin = window.open("", "mgs4u", option);

  displayWin.document.writeln("<HTML>\n<HEAD><TITLE>");
  displayWin.document.writeln(title);
  displayWin.document.writeln("</TITLE></HEAD>\n<BODY bgcolor=\"#FFFFFF\">");
  displayWin.document.writeln("<div align=\"center\">");
  displayWin.document.writeln(title + "<BR><img src=\"" + imgfile + "\"> <br>" + desc);
  displayWin.document.writeln("<P><a href=Javascript: onClick=\"parent.window.close()\"><b>Close Window</b></a></p></div>"); 
  displayWin.document.writeln("</BODY>\n</HTML>");
  displayWin.document.close();
  displayWin.focus();
}

function openNewDisplayWindowText(textfile) {
  // create the window
 
  option = "toolbar=0,scrollbars=1,resizable=1,width=820,height=600,status=0,directories=0,location=0";

  displayWin = window.open("", "mgs4utext", option);
  displayWin.location = "http://www.mgs4u.com/textload.php?textfile=" + textfile;
  displayWin.focus();
}

