document.write('<link rel="Stylesheet" type="text/css" href="common.css">')

function noise(){
  noiseDate = new Date();
  return noiseDate.getTime();
}

function show(imgname,w,h){
  if(h>700){
    prefs="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,left=0,top=0,screenX=0,screenY=0,resizable=0,width="+(Number(w)+17)+",height=700";
  }else{
    prefs="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,left=0,top=0,screenX=0,screenY=0,resizable=0,width="+w+",height="+h;
  }  
  prevWin=window.open("","",prefs);
  prevWin.document.write("<html><body bgcolor='#ffffff' onBlur='self.close();' marginwidth=0 marginheight=0 topmargin=0 leftmargin=0><div><img src="+imgname+" border=0 height="+h+" width="+w+"></div></body></html>");
  prevWin.document.close();
}

function ntg(){}

function openPopUpWin(){
  PopUpWinArgs = openPopUpWin.arguments
  if(PopUpWinArgs[0]) docName = PopUpWinArgs[0]; else docName = "/static/blank.ws"
  if(PopUpWinArgs[1]) winScrollbars = PopUpWinArgs[1]; else winScrollbars = 1
  if(PopUpWinArgs[2]) winWidth = PopUpWinArgs[2]; else winWidth = 550
  if(PopUpWinArgs[3]) winHeight = PopUpWinArgs[3]; else winHeight = 400
  if(PopUpWinArgs[4]) winStatus = PopUpWinArgs[4]; else winStatus = 1
  if(PopUpWinArgs[5]) winResizable = PopUpWinArgs[5]; else winResizable = 0
  if(PopUpWinArgs[6]) winName = PopUpWinArgs[6]; else winName = "PopUpWin"

  PopUpWinProp="toolbar=0,location=0,directories=0,status="+winStatus+",menubar=0,scrollbars="+winScrollbars+",resizable="+winResizable+",width="+winWidth+",height="+winHeight+",left=0,top=0,screenX=0,screenY=0";
  PopUpWin=window.open(docName,winName,PopUpWinProp);
}

function openMenuWin(docName,w,h,scrollbars,e,MenuWinName){
  var posx = 0; var posy = 0;
  if(e){
    posx = e.screenX
    posy = e.screenY
  }
  if((posy+h+55) > screen.height) posy-=(h+25)
  if((posx+w) > screen.width) posx-=(w+5)

  MenuWinProp="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+scrollbars+",resizable=0,left="+posx+",top="+posy+",screenX="+posx+",screenY="+posy+",width="+w+",height="+h
  MenuWin=window.open(docName,MenuWinName,MenuWinProp)
}  

function showSnap(imgname,w,h,title){
  maxHeight = 650
  defHeight = 650
  prefs="toolbar=0,location=0,directories=0,status=0,menubar=0,left=0,top=0,screenX=0,screenY=0,resizable=0,scrollbars="
  if(h > maxHeight){prefs += "1,width="+(w+16+20)+",height="+defHeight+25}else{prefs += "0,width="+(w+20)+",height="+(h+25)}
  snapWin=window.open("","snapWin",prefs);
  snapWin.document.write("<html><title>"+title+"</title><body bgcolor='#ffffff' onBlur='self.close()' onLoad='self.focus()' marginwidth=10 marginheight=12 topmargin=12 leftmargin=10><div><img src="+imgname+" border=0 height="+h+" width="+w+" alt='"+title+"'></div></body></html>");
  snapWin.document.close();
}
