function detailWindow(image, width, height) {

var winwidth = width + 50;
var winheight = height + 50;

var a = "resizable, width=" + winwidth + ", height=" + winheight;

var w = window.open("", "detailwin", a);

var d = w.document;
var div = "<div id='Layer1' style='position:absolute; width:" + width + "px; height:" + height + "px; left: 25px; top: 25px'>";

var s = "<img align='absmiddle' src='" + image + "' width='" + width + "' height='" + height + "'>";

   d.write("<html><head><title>" + desc + "</title></head><body>");
   d.write(div); 
   d.write(s);
   d.write("</div>");
   d.write("</body></html>");
   d.close();
}
function PopupPic(sPicURL, title) { 
	window.open("popup.htm?"+sPicURL+"?"+title, "", "resizable=1,HEIGHT=200,WIDTH=200");
}
	
function imageWindow(image, width, height, desc, detail, detailw, detailh) {

var winwidth = width + 50;
var winheight = height + 50;

var a = "resizable, width=" + winwidth + ", height=" + winheight;

var w = window.open("", "imagewin", a);

var d = w.document;
var div = "<div id='Layer1' style='position:absolute; width:" + width + "px; height:" + height + "px; left: 25px; top: 25px'>";

var s = "<img align='absmiddle' src='" + image + "' width='" + width + "' height='" + height + "'>";
var dtl = "<div align='center'><a href='#' onClick=";
var q = '"';
var dtl2 = "detailWindow('" + detail + "'," + detailw + "," + detailh + ");";
var dtl3 = ">Detail</a></div>"; 
var inc = "<script src='style/rollover.js' type='text/javascript'></script>";

   d.write("<html><head><title>" + desc + "</title>");
   if (detail != "") {
//      d.write(inc);
//     alert(inc);
   }
   d.write("</head><body>");
   d.write(div); 
   d.write(s);
   if (detail != "") {
      d.write(inc);
      d.write(dtl);
      d.write(q);
      d.write(dtl2); 
      d.write(q);
      d.write(dtl3);
   }
   d.write("</div>");
   d.write("</body></html>");
   d.close();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




var newWindow = null;
function closeWin(){
if (newWindow != null){
if(!newWindow.closed)
newWindow.close();
}
}
function popUpWin(url, type, strWidth, strHeight){
closeWin();
if (type == "fullScreen"){
strWidth = screen.availWidth - 10;
strHeight = screen.availHeight - 160;
}
var tools="";
if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
newWindow = window.open(url, 'newWin', tools);
newWindow.focus();
}








