
var global = new Object();
global["html.head"] = "<table width='780' border='0' cellpadding='0' cellspacing='0'align='center' bgcolor='#FFFFFF'><tr><td height='70' colspan='2'><span class='title-background-image' /></td></tr><tr><td height='27' valign='middle' style='padding-left:5' bgcolor='#EDEDED'><b> \u69d8</b></td><td align='right' valign='middle' style='padding-right:5'bgcolor='#EDEDED'><a href='#' styleClass='t1'>\u30db\u30fc\u30e0</a>&nbsp;<a href='#' styleClass='t1'>\u30d1\u30b9\u30ef\u30fc\u30c9\u8a2d\u5b9a</a>&nbsp;<a href='#' styleClass='t1'>\u30ed\u30b0\u30a2\u30a6\u30c8</a></a>&nbsp;</td></tr><tr><td colspan='2' height='1'></td></tr><tr><td colspan='2' height='23' style='padding-left:5' bgcolor='#FFFFCC'><mg page='/image/template/icon-path.gif' border='0' /><!--   path info  --></td></tr><tr><td colspan='2' height='3'background='../image/template/top-split.gif'></td></tr></table><table width='780' border='0' cellpadding='0' cellspacing='0'align='center' bgcolor='#FFFFFF'><tr><td height='' align='center' valign='top'style='padding:10 40 20 40;'>";
global["html.foot"] = "</td></tr></table><table width='780' border='0' cellpadding='0' cellspacing='0'align='center' bgcolor='#FFFFFF'><tr><td height='1' bgcolor='#CCCCCC'></td></tr><tr><td height='22' bgcolor='#FFFFFF' align='left' valign='middle'><font color='#000000' style='font-family:Regular;font-size:10'>&nbsp;&nbsp;AllRights Reserved by PFPS ResearchCo.,Ltd.&nbsp;&nbsp;&nbsp;&nbsp;Version 1.01</font></td></tr></table></body></html>";
// update start by zhanglei on 2007-04-06 11:17
/*
if (typeof window.jQuery != "undefined") {
	$("document").ready(function () {
		var content = $("table#content");
		htmlInit(content);
	});
}

function htmlInit(t) {
	t.before(global["html.head"]);
	t.after(global["html.foot"]);
}
*/
// update end   by zhanglei on 2007-04-06 11:17
function showConfirmDialog(msg) {
	return confirm(msg);
}
function showPopupWindow(url, width, height) {
	if (height == null) {
		height = 200;
	}
	if (width == null) {
		width = 400;
	}
	var features = "height=" + height + ",width=" + width + ",scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,status=no";
	//alert(getOs());
	  // 判断浏览器类型并修改URL
	//if (getOs() == "Gecko") { // FireFox用的是Gecko的内核，所以并不是返回FireFox 参考：http://baike.baidu.com/view/404125.htm
		//url = url.substring(url.indexOf("/") + 1);
		//alert(url);
	//}
	var popup = window.open(url, "popup", features);
	popup.focus();
	//return false;
}

// add by chengwj 20051227 begin
// the mothed check if a string include a illegal character
function checkIllegalChar(str) {
	var illegal = new Array("?", "&", ";", ":", "|", "'", "\"", ">", "<", "=", "_", "%", "$", "*", "{", "}", "/", "\\");
	for (var i = 0; i < str.length; i++) {
		var code1 = str.charCodeAt(i);
		for (var j = 0; j < illegal.length; j++) {
			var code2 = illegal[j].charCodeAt(0);
			if (code1 == code2) {
				return true;
				break;
			}
		}
	}
	return false;
}
String.prototype.Trim = function () {
	return this.replace(/(^\s*)|(\s*$)/g, "");
};
String.prototype.Ltrim = function () {
	return this.replace(/(^\s*)/g, "");
};
String.prototype.Rtrim = function () {
	return this.replace(/(\s*$)/g, "");
};
// add by chengwj 20051227 end
//edit by fb 2007/10/16 start
  /**
   * Method Name		: createPassword
   * Description		: パスワードを作成
   * 
   * @param length
   */
  function createPassword(length) {
	//var CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var CHARSET = "0123456789abcdefghijklmnopqrstuvwxyz";
	var LENGTH = 8;
	var count = CHARSET.length;
	var pwd="";

	if (typeof(length) =="undefined" || length <= 0){
		length = LENGTH;
	}
	
	for( var i=0; i<length; i++){
		var pos = Math.floor(Math.random() * count);
		pwd +=CHARSET.charAt(pos);
	}
	
	return pwd;
  }
  /**
   * Method Name		: isChecked
   * Description		: チェックボックスを選択
   * 
   * @param field
   * @return はい：1 いえ：0 ERROR: -1
   */
  function isChecked(field) {
    var flag = 0;
    if (typeof(field) == "object"){
      if (typeof(field.length) == "number"){
        for(var i = 0; i < field.length; i++){
          if (field[i].type=="checkbox" && field[i].checked){
            flag = 1;
            break;
          }
        }
      } else {
        if (field.type=="checkbox" && field.checked)
          flag = 1;
        else
          flag = 0;
      }
    } else {
      flag = -1;
    }
    return flag;
  }
  /**
   * Method Name		: checkAll
   * Description		: 全でチェックボックスを選択される時
   * 
   * @param field
   * @param value
   */
  function checkAll(field, value) {
    if (typeof(field) == "object" || typeof(field) == "function"){
      if (typeof(field.length) == "number"){
        for(var i = 0;i < field.length; i++){
          if (field[i].type == "checkbox") {
            field[i].checked = value;
          }
        }
      } else {
        if (field.type == "checkbox") {
          field.checked = value;
        }
      }
    }
  }  
  /**
   * Method Name		: checkOne
   * Description		: チェックボックスを全で選択される
   * 
   * @param field
   * @param allfield
   * @param value
   */
  function checkOne(field, allfield, value) {
    var count = 0;
    if (typeof(field) == "object" || typeof(field) == "function"){
      if (typeof(field.length) == "number"){
        for(var i = 0;i < field.length; i++) {
          if (field[i].type == "checkbox") {
            if(field[i].checked == false){
              allfield.checked = false;
              break;
            } else {
              count++;
            }
          }
        }
        if(count == field.length){
          allfield.checked = true;
        }
      } else {
        allfield.checked = value;
      }
    }
  }
  // 判断浏览器类型并返回
	function getOs() {
		var OsObject = "";
		if(navigator.userAgent.indexOf("MSIE")>0) {
			return "MSIE";
		}
		if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
			return "Firefox";
		}
		if(isSafari=navigator.userAgent.indexOf("Safari")>0) {
			return "Safari";
		}
		if(isCamino=navigator.userAgent.indexOf("Camino")>0){
			return "Camino";
		}
		if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){
			return "Gecko";
		}	
	}
  //edit by fb 2007/10/16 end
  // table change color

function alternateBgcolor(){
/*
	var x = document.getElementsByName("alternation");

	var len = x.length;
	if(len>1){
		for(var i=1;i<len;i+=2){
			x[i].style.backgroundColor="#eeeeee";
		}
	}
*/
	$("tr[id='alternation']:odd").each(function(i){
   			this.style.backgroundColor="#eeeeee";
 		});
}
  
