<!--
/**
 * made by ariman
 */
var CHARSET = "ko";

/**
 * 문자열 좌우공백 제거 함수
 */
String.prototype.trim = function() {
  	var pattern = !arguments[0] ? /^\s+|\s+$/g
              : new RegExp('^['+arguments[0]+']+|['+arguments[0]+']+$', 'g')
  	return this.replace(pattern, '')
}

/**
 * 최상위 스크립트 클래스
 * 특별한 기능 없음
 */
function Message() {
}


/**
 * 국제화지원을 위해서 동적 해당 메세지 자동 로딩을 만들려다 보류
 */
/*

Message.prototype.load = function(charset) {
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'message_' + charset + '.js';
    document.getElementsByTagName('head')[0].appendChild(script);
}
*/

/**
 * 아직 특별한 기능없음
 */
Message.prototype.showMessage = function(code) {
	//alert(MESSAGES[0]);
}

/**
 * 아직 특별한 기능없음
 */
function Exception() {
}


/**
 * 아직 특별한 기능없음
 */
Exception.prototype = new Message();
Exception.prototype.viewError = function() {
	this.showMessage(0);
}


/**
 * 아직 특별한 기능없음
 */
function CommonScript() {
	var errorMessages;
	Exception.call();
}

/**
 * 아직 특별한 기능없음
 */
CommonScript.prototype = new Exception();
CommonScript.prototype.setErrorMessages = function(messages) {
	this.errorMessages = messages;
}
CommonScript.prototype.getErrorMessages = function() {
	alert(this.errorMessages);
}
CommonScript.prototype.inputText = function() {
}

/**
 * 화면 풀스크린 팝업띄우기 함수
 */
CommonScript.prototype.fullScreen = function(url) {
    var width = screen.width;
    var height = screen.height - 20;
	//window.open(url,'pop','fullscreen');
	window.open(url,'pop','width=' + width + ', height=' + height + ',status=0,scrollbars=1');
}

/**
 * 팝업 함수
 */
CommonScript.prototype.popup = function(url, width, height) {
	window.open(url, 'pop', 'width=' + width + ', height=' + height + ',status=0,scrollbars=1');
}

var commonScript = new CommonScript();

function Calendar() {
	CommonScript.call();
	
	this.getNowDate = function(delimiter) {
		if(delimiter == "") {
			delimiter = ".";
		}
		var date = new Date();
		var toDate = date.getYear() + delimiter ;
		if((date.getMonth() + 1) < 10) {
			toDate += "0";
		}
		toDate += (date.getMonth() +1) + delimiter;
		if(date.getDate() < 10) {
			toDate += "0";
		}
		toDate += date.getMonth();
	}
}

var calendar = new Calendar();

function FormScript() {
	Calendar.call();

	/**
	 * CheckBox 전체 체크하는 함수
	 * 체크박스를 체크 했을 때 아래의 전체 체크박스가 체크되는경우
	 */
    this.checkboxAllCheckByCheckBox = function(form, formName, checkBoxIdName) {
	    	var f = eval("document." + form);
	    	var title = formName;
	    	if(f.elements[title] != null) {
	    		if(f.elements[title].length != undefined) {
	    			for(var i = 0; i < f.elements[title].length; i++) {
	    				if(document.getElementById(checkBoxIdName).checked == true) {
	    					f.elements[title][i].checked = true;
	    				} else {
	    					f.elements[title][i].checked = false;
	    				}
	    			}
	    		} else {
	    			if(document.getElementById(checkBoxIdName).checked == true) {
	    				f.elements[title].checked = true;
	    			} else {
	    				f.elements[title].checked = false;
	    			}
	    		}
	    	}
	}

    /**
     * 폼기반 같은 폼이름을 같는 Checkbox를 전체 체크하는 함수
     * 클릭이벤트로 실행되는 함수
     * This Function is Document's Form Base
     * @param {Object} form - String
     * @param {Object} formName - String
     */
    this.checkboxallCheckInForm = function (form, formName, checkBoxName) {
	    	try {
	    		if(checkBoxName == null) {
	    			var f = eval("document." + form);
	    			var title = formName;
	    			alert(f.elements[title].length);
	    			if(f.elements[title] != null) {
	    				if(f.elements[title].length != undefined) {
	    					for(var i = 0; i < f.elements[title].length; i++) {
	    						//if(f.elements[formName][i].checked == true) {
	    						if(f.elements[checkBoxName][i].checked == true) {
	    							f.elements[title][i].checked = true;
	    						} else {
	    							f.elements[title][i].checked = false;
	    						}
	    					}
	    				} else {
	    					if(f.elements[title].checked == true) {
	    						f.elements[title].checked = true;
	    					} else {
	    						f.elements[title].checked = false;
	    					}
	    				}
	    			}
	    		} else {
	    			this.checkboxAllCheckByCheckBox(form, formName, checkBoxName);
	    		}
	    	} catch(exception) {
	       		this.checkboxAllCheckByCheckBox(form, formName, checkBoxName);
	    	}
    }

    /**
     * 같은 DIV이름을 같는 Checkbox를 전체 체크하는 함수
     * 클릭이벤트로 실행되는 함수
     * This Function is Document's Form Base
     * @param {Object} form - String
     * @param {Object} formName - String
     */
    this.checkboxallCheckInDiv = function(divName, checkBoxDivName) {
	    	try {
	    		if(checkBoxName != null) {
	    			if(document.getElementById(divName) != null) {
	    				if(document.getElementById(divName).length != undefined) {
	    					for(var i = 0; i < document.getElementById(divName).length; i++) {
	    						if(document.getElementById(checkBoxDivName).checked == true) {
	    							document.getElementById(divName)[i].checked = true;
	    						} else {
	    							document.getElementById(divName)[i].checked = false;
	    						}
	    					}
	    				} else {
							if(document.getElementById(checkBoxDivName).checked == true) {
								document.getElementById(divName).checked = true;
							} else {
								document.getElementById(divName).checked = false;
							}
	    				}
	    			}
	    		}
	    	} catch(exception) {
	    	}
    }
}
FormScript.prototype = new CommonScript();

/**
 * 폼 Select에 해당 값으로 셋팅하는 함수
 * 폼기반 함수
 */
FormScript.prototype.setSelectboxInFormByValue = function(formName, elementName, value) {
	var f = eval("document." + formName);
	var obj = typeof(f);
	if(obj.toLowerCase() == "object") {
		if(f.elements[elementName] != null && f.elements[elementName] != undefined) {
			for(var i = 0; i < f.elements[elementName].length; i++) {
				if(f.elements[elementName][i].value == value) {
					f.elements[elementName].selectedIndex = i;
					break;
				}
			}
		} else {
			alert('Not exist form!');
		}
	} else {
		alert('Not exist form!');
	}
	this.viewError();
}

FormScript.prototype.setCheckboxInSimpleForm = function(formName, formElement) {
	if(formName != "" && formElement != "") {
		var f = eval("document." + formName);
		if(f.elements[formElement].checked == false) {
			f.elements[formElement].checked = true;
		}
	} else {
		alert("폼이 지정되지 않거나 해당 폼의 이름이 잘못되었습니다.");
		return;
	}
}

FormScript.prototype.setCheckboxInMultiForm = function(formName, formElement, values) {
	if(formName != "" && formElement != "") {
		var f = eval("document." + formName);
		if(values.length != undefined) {
			if(f.elements[formElement] != null) {
				if(f.elements[formElement].length != undefined) {
					for(var i = 0; i < f.elements[formElement].length; i++) {
						for(var j = 0; j < values.length; j++) {
							if(f.elements[formElement][i].value == values[j]) {
								f.elements[formElement][i].checked = true;
							}
						}
					}
				} else {
					for(var i = 0; i < values.length; i++) {
						if(f.elements[formElement].value == values[i]) {
							f.elements[formElement].checked = true;
						}
					}
				}
			} else {
				alert("지정한 폼이 존재하지 않습니다.");
			}
		}
	} else {
		alert("폼이 지정되지 않거나 해당 폼의 이름이 잘못되었습니다.");
		return;
	}
}

/**
 * 폼 Select 에 해당 값을 셋팅하는 함수
 * Div 기반 함수
 */
FormScript.prototype.setSelectboxInDivByValue = function(idName, value) {
	var div = document.getElementById(idName);

	if(div.length > 0) {
    	for(var i = 0; i < div.length; i++) {
    		if(div[i].value == value) {
    			div.selectedIndex = i;
    			break;
    		}
    	}
    }
}



FormScript.prototype.inputCheckSpecial = function(strobj) {
	var i = 0;
	var special=new Array("~","!","@","#","$","%","^","&","*","(",")","-","=","+","_","`");
	for(i=0; i< special.length;i++) {
		if(strobj == text[i])
			return false;
	}
	return true;
}



/**
 * 특수문자 체크 함수
 */
FormScript.prototype.validateSepcialChar = function(strobj) {
	var ft = true
	for (var i = 0; i < strobj.length; i++) {
		re = /[~!@\#$?{}%<>^&*\()\-=+_\']/gi;
		if(re.test(strobj)) {
			ft = false;
		}

	}
	return ft;
}

/**
 * 숫자와 영대소문자만 허용하는 함수
 */
FormScript.prototype.specialChar = function(formValue) {
    return (formValue.match(/[^(0-9a-zA-Z)]/)) ? false : true;
}

/**
 * 숫자만 허용하는 함수
 */
FormScript.prototype.isNumber = function(strField) {
	var i;
	var ch;
	var isNumeric = true;
	for (i = 0; i < strField.length; i++) {
		ch = strField.charAt(i);
		if (!((ch >= '0') && (ch <= '9')))
			isNumeric = false;
	}
	return isNumeric;　// true, false 반환
}

/**
 * 숫자와 -만 허용하는 함수
 */
FormScript.prototype.isPhoneType = function(strField) {
	var i;
	var ch;
	var isNumeric = true;
	for (i = 0; i < strField.length; i++) {
		ch = strField.charAt(i);
		if (! ( ((ch >= '0') && (ch <= '9')) || ch == "-"  ))
			isNumeric = false;
	}
	return isNumeric;　// true, false 반환
}

/**
 * 이메일 체크 함수
 */
FormScript.prototype.emailCheck =  function (strMail) {
	var check1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	var check2 = /^[a-zA-Z0-9\-\.\_\+]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})$/;

	if ( !check1.test(strMail) && check2.test(strMail) ) {
		return true;
	} else {
		return false;
	}
}

/**
 * 폼텍스트에 해당 값 셋팅하는 함수
 */
FormScript.prototype.setText = function(formName, textName, textValue) {
	try {
		var fName = eval("document." + formName + "." + textName);
		fName.value = textValue;
	} catch(exception) { }
}

/**
 * 폼 라디오버튼에 해당 값 셋팅하는 함수
 */
FormScript.prototype.setRadioButton = function(formName, radioName, val) {
	var f = eval("document." + formName);

	if(f.elements[radioName] != null && f.elements[radioName] != undefined) {
		if(f.elements[radioName].length != undefined) {
			for(var i = 0; i < f.elements[radioName].length; i++) {
				if(f.elements[radioName][i].value == val) {
					f.elements[radioName][i].checked = true;;
					break;
				}
			}
		} else {
			if(f.elements[radioName].value == val) {
				f.elements[radioName].checked = true;;
			}
		}
	}
}


/**
 * 폼 체크 함수
 */
FormScript.prototype.checkForm = function(formName, formElements, formMessages, actionType) {

	if(formName != null) {
		var f = eval("document." + formName);
		if(formElements != null && formElements.length != null && formElements.length != undefined) {
			if(formElements.length == formMessages.length) {
					for(var i = 0; i < formElements.length; i++) {
						if(f.elements[formElements[i]].value == "") {
							alert(formMessages[i]);
							f.elements[formElements[i]].focus();
							if(actionType == "submit") {
								return false;
							} else {
								return;
							}
						}
					}
				return true;
			} else {
				alert(3);
			}
		} else {
			alert(2);
		}
	} else {
		alert(1);
	}
}

/**
 * 해당 값이 같은지 체크하는  함수
 */
FormScript.prototype.isSameValue = function(formName, first, second, actionType) {
	if(formName != null) {
		var f = eval("document." + formName);
		if((f.elements[first] != null && f.elements[first] != undefined) && (f.elements[second] != null && f.elements[second] != undefined)) {
			if(f.elements[first].value == f.elements[second].value) {
				return true;
			} else {
				return false;
			}
		}
	}
}

/**
 * 일본 전각/반각 체크 함수
 */
FormScript.prototype.isZenkaku = function(str)  {
    for(i=0;i<str.length;i++) {
	    if(escape(str.charAt(i)).length >= 4) {
		    //alert("全角文字が含まれています");
		    return true;
	    }
    }
    //alert("全角文字は含まれていません");
    return false;
}


/**
 * 해당 문자열이 이미지 확장자를 갖고 있는지 체크하는 함수
 */
FormScript.prototype.isImage = function(str) {
    if((str.lastIndexOf(".jpg")==-1) && (str.lastIndexOf(".gif")==-1) && (str.lastIndexOf(".JPG")==-1) && (str.lastIndexOf(".GIF")==-1)) {
        return false
    }
    return true;
}

FormScript.prototype.calcTextLength = function(fname, elementName, maxLength) {
	var f  = eval("document." + fname);
	if(f.elements[elementName].length >= maxLength) {
		return true;
	}
	return false;
}

var formScript = new FormScript();

function DivScript() {
	CommonScript.call();
}
DivScript.prototype = new CommonScript();
DivScript.prototype.previewByLightbox = function(imagePath) {
	// IE6, IE7
    var isIE = false;
    isIE = (window.navigator.userAgent.indexOf("MSIE") != -1);

	alert(isIE);
	if(isIE) {
		//document.getElementById('imgview').href = this.value;
		document.getElementById('mmmm').innerHTML = '<a href="' + imagePath + '" id="imgview" ref="lightbox" title=""><img src="/images/common/button/photo_up.gif" width="177" height="17" alt="画像アップ" border="0"></a>';
	} else {
		//document.getElementById('imgview').href = "file:\\" + this.value;
		document.getElementById('mmmm').innerHTML = '<a href="file:\\' + imagePath + '" id="imgview" ref="lightbox" title=""><img src="/images/common/button/photo_up.gif" width="177" height="17" alt="画像アップ" border="0"></a>';
	}
}

var divScript = new DivScript();


function CookieScript() {
	CommonScript.call();
}
CookieScript.prototype = new CommonScript();
CookieScript.prototype.setCookie = function(cookieName, cookieValue) {
	try {
    	var objExpireDate = new Date();
    	objExpireDate.setDate(objExpireDate.getDate() + 360);
    	document.cookie = cookieName + "=" + escape(cookieValue) + "; path=/; expires=" + objExpireDate.toGMTString() + ";";
    } catch(exception) {
    }
}

CookieScript.prototype.unSetCookie = function(cookieName) {
	try {
    	var objExpireDate = new Date();
    	objExpireDate.setDate(objExpireDate.getDate() - 1);
    	document.cookie = cookieName + "=;expires=" + objExpireDate.toGMTString();
    } catch(exception) {
    }
}

CookieScript.prototype.getCookie = function(cookieName) {
	var strCookieName = cookieName + "=";
	var objCookie = document.cookie;
	try {
    	if (objCookie.length > 0) {
    		var nBegin = objCookie.indexOf(strCookieName);
    		if (nBegin < 0) {
    			return;
    		}
    		nBegin += strCookieName.length;
    		var nEnd = objCookie.indexOf(";", nBegin);
    		if (nEnd == -1) {
    			nEnd = objCookie.length;
    		}
    	}
    	return unescape(objCookie.substring(nBegin, nEnd));
    } catch(exception) {
    }
}
var cookieScript = new CookieScript();


TextSlider = function(className) {
    document.write("<div id='TextSliderPLayer_"+ className +"'><div id='TextSliderLayer_"+ className +"'></div></div>");

    this.item = [];
    this.width = this.height = this.speed = this.pixel = this.interval =
        this.size = this.moveCount = this.X = this.Y = 0;
    this.direction = "";
    this.pLayer = document.getElementById("TextSliderPLayer_"+ className);
    this.layer = document.getElementById("TextSliderLayer_"+ className);
    this.align = "left";
    this.intervalId = null;
    this.className = className;
    this.isPause = false;
}
TextSlider.prototype.init = function() {
    with (this.pLayer.style) {
        width = this.width+"px";
        height = this.height+"px";
        overflow = "hidden";
    }
    with (this.layer.style) {
        width = this.direction=='up' || this.direction=='down' ? this.width+"px" : this.size*(this.item.length+1)+"px";
        height = this.direction=='up' || this.direction=='down' ? this.size*(this.item.length+1)+"px" : this.height+"px";
        top = 0;
        left = 0;
        position = "relative";
    }
    for (var i=0; i<parseInt(this.height / this.size, 10)+1; i++)
        this.item[this.item.length] = this.item[i];
    switch (this.direction) {
        case "up": this.X = this.Y = 0; break;
        case "down": this.X = 0; this.layer.style.top = this.Y = -this.size*(this.item.length-1); break;
        case "left": this.X = this.Y = 0; break;
        case "right": this.Y = 0; this.layer.style.left = this.X = -this.size*(this.item.length-1); break;
    }
    var __html = "<div onmouseover='"+this.className+".pause()' onmouseout='"+this.className+".unpause()'>";
    if (this.direction=='up' || this.direction=='down') {
        __html += "<table width='"+ this.layer.style.width +"' cellspacing='0' cellpadding='0' border='0'>";
        for (var i in this.item)
            __html += "<tr><td height='"+this.size+"' style='overflow:hidden' align='"+this.align+"' valign='top'>"+this.item[i]+"</td></tr>";
        __html += "</table>";
    } else {
        __html += "<table cellspacing='0' cellpadding='0' border='0'><tr>";
        for (var i in this.item)
            __html += "<td width='"+this.size+"' height='"+ this.layer.style.height +"' align='"+this.align+"' \
                valign='top' style='overflow:hidden;'>"+this.item[i]+"</td>";
        __html += "</tr></table>";
    }
    __html += "</div>";
    this.layer.innerHTML = __html;
    this.start();
}
TextSlider.prototype.start = function() {
    this.intervalId = setInterval(this.className+".move()", this.speed);
}
TextSlider.prototype.move = function() {
    if (this.isPause) return;
    switch (this.direction) {
        case "up": this.Y -= this.pixel; break;
        case "down": this.Y += this.pixel; break;
        case "left": this.X -= this.pixel; break;
        case "right": this.X += this.pixel; break;
    }
    if (this.direction=='up' || this.direction=='down') {
        if (Math.abs(this.Y)%this.size==0) this.stop();
        this.layer.style.top = this.Y;
    } else {
        if (Math.abs(this.X)%this.size==0) this.stop();
        this.layer.style.left = this.X;
    }
}
TextSlider.prototype.stop = function() {
    clearInterval(this.intervalId);
    switch (this.direction) {
    case "up":
        if (Math.abs(this.Y) >= parseInt(this.layer.style.height,10)-this.size) this.Y = this.layer.style.top = 0;
        break;

    case "down":
        if (Math.abs(this.Y) <= 0) this.Y = this.layer.style.top = -this.size*(this.item.length-1);
        break;

    case "left":
        if (Math.abs(this.X) >= parseInt(this.layer.style.width,10)-this.size) this.X = this.layer.style.left = 0;
        break;

    case "right":
        if (Math.abs(this.X) <= 0) this.X = this.layer.style.left = -this.size*(this.item.length-1);
        break;
    }
    setTimeout(this.className+".start()", this.interval);
}
TextSlider.prototype.pause = function() {this.isPause = true;}
TextSlider.prototype.unpause = function() {this.isPause = false;}



/**
 * Flash Script
 */
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion() {
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");

			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful.

			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}

	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;

	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?');
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs)
{
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();

    switch (currArg){
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace":
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}





var cate_uid1 = [0, 11,15,16,12,11,14];
var cate_name1 = ['全て', 'あそぶ','まなぶ','かんがえる','うたう','えほん','えいご'];


var cate_uid2 = [0,4,5,7,8,9];
var cate_name2 = ['全て', '出産', '育児', '教育', '食事', 'その他'];

var cate_uid3 = [0,3,290,4,5,6,7,17,291];
var cate_name3 = ['全て','妊娠', '胎教', '出産','育児','離乳食', '教育', '健康・美容', '住まい'];

var item_uid = [0,1,2];
var item_name = ['全て', 'タイトル', '記事'];
function getSearchCategory(idx, type, category, item) {

	setSearchCate('');
	setSearchItem('');

	var txt = "<select name='category_uid'  onChange=\"setSearchCate(this.value);\">\n";
	var txt2 = "<select name='item' onChange=\"setSearchItem(this.value);\">\n";
	var select = "";
	if(idx == 1) {
		for(var i = 0; i < cate_uid1.length; i++) {
			if(category != "" && category == cate_uid1[i]) {
				select = "selected";
			} else {
				select = "";
			}
			txt += "<option " + select + " value='" + cate_uid1[i] + "'>" + cate_name1[i] + "</option>";
		}
		txt2 += "<option value='1'>タイトル</option>";
	} else if(idx == 2) {
		for(var i = 0; i < cate_uid2.length; i++) {
			if(category != "" && category == cate_uid2[i]) {
				select = "selected";
			} else {
				select = "";
			}

			txt += "<option " + select + " value='" + cate_uid2[i] + "'>" + cate_name2[i] + "</option>";
		}

		for(var j = 0; j < item_uid.length; j++) {
			if(item != "" && item == item_uid[j]) {
				select = "selected";
			} else {
				select = "";
			}
			txt2 += "<option " + select + " value='" + j + "'>" + item_name[j] + "</option>";
		}

	} else if(idx == 3) {
		for(var i = 0; i < cate_uid3.length; i++) {
			if(category != "" && category == cate_uid3[i]) {
				select = "selected";
			} else {
				select = "";
			}
			txt += "<option " + select + " value='" + cate_uid3[i] + "'>" + cate_name3[i] + "</option>";
		}
		for(var j = 0; j < item_uid.length; j++) {
			if(item != "" && item == item_uid[j]) {
				select = "selected";
			} else {
				select = "";
			}
			txt2 += "<option " + select + " value='" + j + "'>" + item_name[j] + "</option>";
		}
	}
	txt += "</select>\n";
	txt2 += "</select>\n";


	document.getElementById("sub_category1").innerHTML = "";
	document.getElementById("sub_category1").innerHTML = txt;


	//if(type == "detail") {
		document.getElementById("sub_item1").innerHTML = "";
		document.getElementById("sub_item1").innerHTML = txt2;

}

function setSearchCategory(service, category, item) {
	getSearchCategory(val, 'detail', category, item);
}

function setSearchCate(val) {
	document.searchForm.category_uid.value = val;
}
function setSearchItem(val) {
	document.searchForm.item.value = val;
}

function doSearch(type) {
	if(document.searchForm.word.value == "") {
		alert('検索キーワードを入力してください');
		return false;
	}
	return true;
}

function memberPhotoUp(url) {
	document.domain = "mamato.jp";
	commonScript.popup(url, 500, 300);
}
OPENER_WINDOW = "mamato";


function commonConfirmAction(form, action, id) {
	var f = eval("document." + form);
	//document.getElementById(id).action = action;
	//f.action = action;
	f.submit();
	//document.getElementById(id).submit();
}



function setterId() {
	var id = cookieScript.getCookie("save_id");
	if(id == undefined || id == "undefined") {
		id = "";
	}
	try {
    	if(id != "" && document.logonForm.save_id != null && document.logonForm.save_id != undefined) {
    		document.logonForm.member_id.value = id;
    		document.logonForm.save_id.checked = true;
    		document.logonForm.member_id.focus();
    		//document.getEmenetById("member_id").style.backgroundImage='';
    		//document.getEmenetById("member_pw").style.backgroundImage='';
    	}
    } catch(exception) {
    }
}

function setProcId(name, value) {
	if(document.logonForm.save_id.checked == true) {
		cookieScript.setCookie(name, value);
	} else {
		cookieScript.unSetCookie(name);
	}
}


function setJqueryEditor(name) {
	var val = "#" + name;
	//$(function() {
	//	$().datepicker({showOn: 'button', buttonImage: '/images/calendar.gif', buttonImageOnly: true});
	//});
	//$(val).markItUp(mySettings);
}

/*
function printDiv(){
	if (window.print){
		window.onbeforeprint = beforeDivs;
		window.onafterprint = afterDivs;
		window.print();
	}
}

function beforeDivs(){
	//document.getElementById("objContents").style.display = 'none';
	document.getElementById("objSelection").innerHTML = document.getElementById("print_contents").innerHTML;
}

function afterDivs(){
	//document.getElementById("objContents").style.display='block';
	document.getElementById("objSelection").innerHTML = "";
}
*/

var initBody;

function printDiv(){
	if (window.print){
		window.onbeforeprint = beforeDivs;
		window.onafterprint = afterDivs;
		window.print();
	}
}

function beforeDivs(){
	initBody = document.body.innerHTML;
	document.body.innerHTML = document.getElementById("print_contents").innerHTML;
}


function afterDivs(){
	document.body.innerHTML = initBody;
}

function Paginate() {
	this.params = "";
	
	this.setParamUTF8 = function(param) {
		for(var i in param) {
			this.params += i + "=" + encodeURIComponent(param[i]);
		}
	}
	
	this.setParam = function(param) {
		for(var i in param) {
			this.params += i + "=" + param[i];
		}
	}
	
	this.send = function(url) {
		url = url + "&" + this.params;
		document.location.href = url;
	}
}
var paginate = new Paginate();

//-->
