function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

function findObj(n, d) { //v4.0
  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=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function changecellcolor(src,color,text,cls) {
	src.style.cursor = 'hand'; 
	src.bgColor = color ;
	var tsrc = findObj(text);
	tsrc.className = [cls];
	src.className = [cls];
}

function showHideLayers() { //v3.0
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ratClk(src){ 
	if(event.srcElement.tagName=='TD')
		src.children.tags('A')[0].click();
}

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.0
  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 && document.getElementById) x=document.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];}
}
function setLayer(objName,x,newText) { //v3.0
  if ((obj=findObj(objName))!=null) with (obj)
    if (!navigator.appName=='Netscape' + navigator.appVersion<'6') {innerHTML = unescape(newText);}
}


function img_min_max(file_min,file_max)
	{
	document.write('<A HREF="javascript:show_max(\''+file_max+'\')"><IMG SRC="'+file_min+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="Image"></A>');
	}
function show_max(file)	{
  i1 = new Image;
  i1.src = file;
  html = '<html><head><title>bonKado - Image</title></head><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0><table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%"><tr><td valign="middle" align="center"><img src="'+file+'" border=1 bordercolor=black name=imageTest onLoad="if (document.imageTest.height>600){h=600;} else{h=document.imageTest.height+50;} if (document.imageTest.width>800){w=800;} else{w=document.imageTest.width+50} window.resizeTo(w,h)"></td></tr></table></body></<html>';
  popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1,left=0,top=0');
  popupImage.document.open();
  popupImage.document.write(html);
  popupImage.document.close();
}
function open_doc(file,wi,he,res) {
	var newwin=Math.round(Math.random()*1000000); 
	if (!wi && !he) {show_max(file);}
	else {window.open(file,newwin,'width='+wi+',height='+he+', location=0, menubar=0, resizable='+res+', scrollbars=1, status=1, titlebar=0, toolbar=0,left=0,top=0');}
}
function popup(file,winid, wi, he, res, loc, menu, tool) {
	//alert(wi);
	if (!wi || wi==0) {wi=700;}if (!he || he==0) {he=500;}
	if (!res) {res=0;}if (!menu) {menu=0;}if (!loc) {loc=0;}if (!tool) {tool=0;}
	winidpopup=window.open(file,winid,'width='+wi+',height='+he+', location='+loc+', menubar='+menu+', resizable='+res+', toolbar='+tool+', scrollbars=1, status=1, titlebar=0,left=0,top=0');
}

function menu3(){
if (document.all||document.layers)
makeStatic()
}
function makeStatic() {
if (document.all) {menuleft.style.pixelTop=document.body.scrollTop+250}
else{eval(document.menuleft.top=eval(window.pageYOffset+250));}
setTimeout("makeStatic()",0);
}