// category menu
flag = false;
function treeMenu(tName) {
  tMenu = document.getElementById(tName).style;
  if(tMenu.display == 'none') tMenu.display = "block";
  else tMenu.display = "none";
}

//read more
function showMore(varA1, varB1){
	varRVS = ('varR' + (varA1));
	varMORE = ('varM' + (varA1));
	if( document.getElementById ) {
		if( document.getElementById(varRVS).style.display ) {
			if( varB1 != 0 ) {
				document.getElementById(varRVS).style.display = 'block';
				document.getElementById(varMORE).style.display = 'none';
			} else {
				document.getElementById(varRVS).style.display = 'none';
				document.getElementById(varMORE).style.display = 'block';
			}
		} else {
			location.href = varB1;
			return true;
		}
	} else {
		location.href = varB1;
		return true;
	}
}

// pop up window
function winOpen(url,w,h) {
  var winFig;
  var width = parseInt(w);
  var height = parseInt(h);

  st = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrolbars=no,resizable=no,";
  winFig = window.open("", "OpenWin", st+"width="+width+",height="+height);

  winFig.document.open();
  winFig.document.writeln("<html>");
  winFig.document.writeln("<head><title>image window</title></head>");
  winFig.document.writeln('<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">');
  winFig.document.writeln('<a href="javascript:void(0);" onClick="self.window.close()"><img src="'+url+'" border="0" /></a>');
  winFig.document.writeln("</body>");
  winFig.document.writeln("</html>");
  winFig.document.close();

  var Win   = navigator.userAgent.indexOf("Win") != -1   ? true : false;
  var Mac   = navigator.userAgent.indexOf("Mac") != -1   ? true : false;

  if(Win) {
    if(navigator.userAgent.indexOf("Gecko")!=-1){
      winFig.location.reload();
    }
  }
}

// thanks fj
myStyle = 0;
myStyleTblHeight = new Array("300px","100%");

function srtm() {
myStyle = ( myStyle == 0) ? 1 : 0;
document.getElementById("style1").style.height = myStyleTblHeight[myStyle];
}

