var win=null;
var rand = Math.round(Math.random() * 9999999);
var randStr = rand.toString();

function wait(delay){
  window.status = "Please wait for a few seconds (saving)...";
  setTimeout('pause()',delay);
}
function pause(){
	document.forms[0].submit();
}

function makeDate(){
	today = new Date();
	month = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	day = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
	document.write (day[today.getDay()] + ", " + month[today.getMonth()] + " " + today.getDate() + ", " + today.getFullYear());
}

function proceed(process, num) {
  document.forms[0].process.value = process;
  document.forms[0].num.value = num;
	document.forms[0].submit();
}

function proceed2(process, num, num2) {
  document.forms[0].process.value = process;
  document.forms[0].num.value = num;
  document.forms[0].num2.value = num2;
	document.forms[0].submit();
}

function proceedx(process, num, hidObj) {
  hidObj.value = document.all.dynamsg.html;
  document.forms[0].process.value = process;
  document.forms[0].num.value = num;
	document.forms[0].submit();
}

function proceedxx(process, num, hidObj1, hidObj2) {
  hidObj1.value = document.all.dynamsg1.html;
  hidObj2.value = document.all.dynamsg2.html;
  document.forms[0].process.value = process;
  document.forms[0].num.value = num;
	document.forms[0].submit();
}

function proceedx4(process, num, hidObj1, hidObj2, hidObj3, hidObj4) {
  hidObj1.value = document.all.dynamsg1.html;
  hidObj2.value = document.all.dynamsg2.html;
  hidObj3.value = document.all.dynamsg3.html;
  hidObj4.value = document.all.dynamsg4.html;
  document.forms[0].process.value = process;
  document.forms[0].num.value = num;
  wait(5000);
}

function gotopage(page) {
	document.forms[0].process.value = "goto";
	document.forms[0].action += "?page=" + page + "&hit=" + randStr;
	document.forms[0].submit();
}

function gotopageglos(page, glos) {
	document.forms[0].process.value = "goto";
	document.forms[0].action += "?page=" + page + "&glos=" + glos + "&hit=" + randStr;
	document.forms[0].submit();
}

function newWindow(mypage,myname,w,h,scroll,pos){
  if(pos=="random"){
    LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
    TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
  }
  if(pos=="center"){
    LeftPosition=(screen.width)?(screen.width-w)/2:100;
    TopPosition=(screen.height)?(screen.height-h)/2:100;
  }
  else if((pos!="center" && pos!="random") || pos==null){
    LeftPosition=0;TopPosition=20
  }
  settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
  win=window.open(mypage,myname,settings);
}
