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);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  windowOpener(theURL,winName,features);
}

function MM_openFullBrWindow(theURL,winName) { //v1.0
  windowOpener(theURL,winName,'width=760,height=420,resizable=1,scrollbars=1,status=1,toolbar=1,location=1,menubar=1');
}

function MM_openFullSizeBrWindow(theURL,winName) { //v1.0
  windowOpener(theURL,winName,'resizable=1,scrollbars=1,status=1,toolbar=1,location=1,menubar=1');
}

function clearBox(box) {
			if (box.value == box.defaultValue) {
    			box.value = "";
			}
}

// the following code opens new window if
// it does not already exist
// If it is already opened, the window will 
// be brought into focus 

popupWins = new Array();

function windowOpener(url, name, args) {
	/******************************* 
	the popupWins array stores an object reference for
	each separate window that is called, based upon
	the name attribute that is supplied as an argument
	*******************************/
	
	if ( typeof( popupWins[name] ) != "object" ){
		popupWins[name] = window.open(url,name,args);
	} else {
		if (!popupWins[name].closed){
			// popupWins[name].location.href = url; // comment out to avoid refresh of flash player on host chat
		} else {
			popupWins[name] = window.open(url, name,args);
		}
	}
	
	popupWins[name].focus();
}

function confirm_delete(){ 
	var del;
	del = confirm('Are you sure you want to delete?');

	if(del){
		return true;
	} else{ 
		return false;
	} 
}

function switchFlag(variable) {
  var query = location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
    
      if (pair[1] == "all") {
      var jp = document.getElementById('sw_jp');
      var wd = document.getElementById('sw_wd');
      
      jp.src = "/images/ja/switch_jp_off.gif";
      wd.src = "/images/ja/switch_wd_on.gif";
      }
    }
  } 
}

function writeStickamStaff(locale) {
	document.write('<embed src="http://www.stickam.com/flashVarChatPlayer/170060346-3" width="160" height="160" hspace="0" vspace="0" type="application/x-shockwave-flash" id="stickamStaff" name="stickamStaff" border="0" ></embed>');
}

function writeHeaderLogo(locale) {
	var langCD = 'ja';
	if (locale == '' || locale == 'en') {
		langCD = 'en';
	}
	
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="header_logo" width="160" height="60" hspace="0" vspace="0" align="left" id="header_logo">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="/img/header_logo.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="/img/header_logo.swf" width="160" height="60" hspace="0" vspace="0" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="header" align="left" menu="false" wmode="transparent" allowScriptAccess="always"></embed>');
	document.write('</object>');
}