// CSS choose on browser
	tmt_css_NN = "../_css/mc03_net.css";
	tmt_css_IE = "../_css/mc03_ie.css";
	if(document.layers||document.getElementById){
   document.write("<link rel='stylesheet' href='" + tmt_css_NN + "' type='text/css'>");
}
if(document.all){
   document.write("<link rel='stylesheet' href='" + tmt_css_IE + "' type='text/css'>");
}


// Netscape resize fix
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


// The remote launching code.
	function remotePOP(def) {
	remote=window.open("","remotewin","width="+def.size[0]+",height="+def.size[1]);
	remote.location.href=def.url;
	if (remote.opener==null) remote.opener=window;
}
	
	
// pop off windows
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function picPOP(def){
  def.pref={
    border:5,
    caption:22,
    color:{
      border:"#333333",
      caption:"#333333",
      type:"#999999"
    }
  }
  def.browser={
    n:(document.layers)? 1:0,
    ie:(document.all)? 1:0,
    dom:(document.getElementById)? 1:0,
    win:(navigator.platform.indexOf("Win")!=-1)? 1:0
  }
    def.winborder=(def.browser.ie&&def.browser.win)? (new Array(0,0)):(new Array(10,30));
  def.pos=new Array();
  def.ratio=new Array();
  def.screen=new Array(screen.availWidth,screen.availHeight);
  def.winsize=new Array(def.size[0]+(def.pref.border*2)+def.winborder[0],def.size[1]+(def.pref.border*2)+def.pref.caption+def.winborder[1]);
  for (i=0;i<=1;i++) if (def.winsize[i]>def.screen[i]-20) def.ratio[def.ratio.length]=((def.screen[i]-20)/def.winsize[i]);
  if (def.ratio.length!=0){
    def.ratio=def.ratio.sort();
    def.originalsize=new Array(def.size[0],def.size[1]);
    for (i=0;i<=1;i++){ def.size[i]=def.size[i]*def.ratio[0];}
    def.scaled=true;
  }
  def.winsize=new Array(def.size[0]+(def.pref.border*2),def.size[1]+(def.pref.border*2)+def.pref.caption);
  for (i=0;i<=1;i++) def.pos[i]=Math.floor((def.screen[i]/2)-(def.winsize[i]/2)-(def.winborder[i]/2));
  // set window name
  def.name=def.url[1];
  def.variations={are:((def.url[2]!=null)? 1:0),index:0,label:def.url[2]};
  def.url=def.url[0]+def.url[1]+((def.variations.are)? "_"+def.url[2][def.variations.index]:"")+"."+def.url[3];
  if (def.browser.ie&&def.browser.win){
    eval(def.name+"=window.open(\"\",def.name,\"status=0,toolbar=0,directories=0,menubar=0,personalbar=0,titlebar=0,resizeable=0,fullscreen=1,scrollbars=0\")");
    eval(def.name+".moveTo(def.pos[0],def.pos[1])");
    eval(def.name+".resizeTo(def.winsize[0],def.winsize[1])");
  }else{
    eval(def.name+"=window.open(\"\",def.name,\"left="+def.pos[0]+",top="+def.pos[1]+",width="+def.winsize[0]+",height="+def.winsize[1]+",status=0,toolbar=0,directories=0,menubar=0,personalbar=0,titlebar=0,resizeable=0,fullscreen=0,scrollbars=0\")");
  }
  // write the popup html code
  def.html="<html><head>\n";
  def.html+="<title>"+def.title+"</title>\n";
  def.html+="<style>td {font-family: Verdana, Helvetica, sans-serif; color: "+def.pref.color.type+"; font-size: 9.9px}</style>\n";
  // prepare a script for switching variations if the exist
  if (def.variations.are){
    def.html+="<script>\n";
    def.html+="variations=[\""+def.variations.label.join("\",\"")+"\"];\n";
    def.html+="function variation(index){ icon=eval(\"document.pic.src\");icon=icon.slice(0,icon.lastIndexOf(\"_\")+1)+variations[index]+icon.slice(icon.lastIndexOf(\".\"),icon.length);document.pic.src=icon;}\n";
    def.html+="</script>\n";
  }
  def.html+="</head><body bgcolor=\""+def.pref.color.border+"\" leftmargin=\"0\" topmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" link=\"#ccffff\" vlink=\"#ccffff\" scroll=\"no\">\n";
  def.html+="<table width=\""+def.winsize[0]+"\" height=\""+def.winsize[1]+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  def.html+="<tr><td width=\""+def.winsize[0]+"\" height=\""+def.pref.caption+"\" bgcolor=\""+def.pref.color.caption+"\" align=\"center\" valign=\"middle\">\n";
  def.html+="<b>"+def.title+"</b><br>"+def.byline+"";
  // offer variations if they exist
  if (def.variations.are) for (i=0;i<def.variations.label.length;i++) def.html+=" [<a href=\"javascript:variation("+i+");\">"+def.variations.label[i]+"</a>]";
  // show 'was scaled' warning if image was scaled
  if (def.scaled) def.html+=" (scaled image-real size:  "+def.originalsize[0]+"x"+def.originalsize[1]+")";
  def.html+="\n<br></td></tr>\n";
  def.html+="<tr><td width=\""+def.winsize[0]+"\" height=\""+def.size[1]+"\" align=\"center\" valign=\"middle\">\n";
  def.html+="<a href=\"javascript:self.close();\"><img src=\""+def.url+"\" width=\""+def.size[0]+"\" height=\""+def.size[1]+"\" alt=\"\" vspace=\"4\" width=\""+def.size[0]+"\" height=\""+def.size[1]+"\" border=\"0\" name=\"pic\"></a><br>\n";
  def.html+="</td></tr></table>\n";
  def.html+="</body></html>";
  eval(def.name+".document.write(def.html)");
  eval(def.name+".document.close()");
  eval(def.name+".focus()");
}
