//--------------<Public Script>

function jfWriteActivexObject(vDiv,vId,vSrc,vWidth,vHeight){
	var vStrActivex = "";

	if(vDiv == "flash"){
		vStrActivex += "<object id=\"" + vId + "\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\"  width=\"" + vWidth + "px\" height=\"" + vHeight + "px\">";
		vStrActivex += "   <param name=movie value=\"" + vSrc + "\">";
		vStrActivex += "   <param name=quality value=high>";
		vStrActivex += "   <param name=\"wmode\" value=\"transparent\">";
		vStrActivex += "   <embed src=\"" + vSrc + "\" quality=high wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"" + vWidth + "px\" height=\"" + vHeight + "px\">";
		vStrActivex += "   </embed>";
		vStrActivex += "</object>";
	}

	else if(vDiv == "movie"){
		vStrActivex += "<object id=\"" + vId + "\" classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\"  codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" type=\"application/x-oleobject \" align=\"center\" standby=\"Loading Microsoft Windows Media Player components...\"  width=\"" + vWidth + "px\" height=\"" + vHeight + "px\">";
		vStrActivex += "<param name=\"animationatstart\" value=\"0\">";
		vStrActivex += "<param NAME=\"autostart\" value=\"1\">";
		vStrActivex += "<param NAME=\"AutoSize\" value=\"0\">";
		vStrActivex += "<param NAME=\"EnableContextMenu\" Value=\"0\">";
		vStrActivex += "<param NAME=\"playCount\" value=\"100\">";
		vStrActivex += "<param NAME=\"ShowStatusBar\" VALUE=\"0\">";
		vStrActivex += "<param NAME=\"ShowControls\" VALUE=\"1\">";
		vStrActivex += "<param NAME=\"ClickToPlay\" VALUE=\"0\">";
		vStrActivex += "<param NAME=\"TransparentAtStart\" VALUE=\"1\">";
		vStrActivex += "<param name=\"Filename\" value=\"" + vSrc + "\">";
		vStrActivex += "<embed id=\"" + vId + "\" src=\"" + vSrc + "\" width=\"" + vWidth + "px\" height=\"" + vHeight + "px\" autostart=\"1\" align=\"center\" animationatstart=\"0\" autosize=\"0\" enablecontextmenu=\"0\" playcount=\"-1\" showstatusbar=\"0\" showcontrols=\"0\" clicktoplay=\"0\" transparentatstart=\"1\" filename=\"\">";
		vStrActivex += "</embed>"; 
		vStrActivex += "</object>";    
	}
	document.write(vStrActivex);
}

	function SendThisForm(vForm,vAction,vTarget,vMethod,vEncoding){
		f = vForm;
		f.action = vAction;
		f.target = vTarget;
		f.method = vMethod;
		if(vEncoding == "file")f.encoding = "multipart/form-data";
		f.submit();
	}

	function jfSendThisForm(vForm,vAction,vTarget,vMethod,vEncoding){
		f = vForm;
		f.action = vAction;
		f.target = vTarget;
		f.method = vMethod;
		if(vEncoding == "file")f.encoding = "multipart/form-data";
		f.submit();
	}

    function IsNull(obj) {
        if (obj.value == null || obj.value.replace(/ /gi,"") == "") {
            return true;
        }
        return false;
    }
	function ClearThisForm(vForm){
		f = vForm;
		f.reset();
	}

	function PopUpWin(Url,PopName,Condition) {
	    if (Url != ""){
			vPopUpWin = window.open(Url, PopName, Condition);
			vPopUpWin.focus();
		}
	}

    function RemoveSpaces(str) {
        var ret = "";
        if (str.length == 0) return ret;

        for (var i=0; i<str.length; i++) {
            if (str.charAt(i) != " ") ret += str.charAt(i);
        }
        return ret;
    }

    function ContainsCharsOnly(obj,chars) {
        for (var inx = 0; inx < obj.value.length; inx++) {
           if (chars.indexOf(obj.value.charAt(inx)) == -1)
               return false;
        }
        return true;
    }

    function IsAlphaNum(obj) {
        var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        return ContainsCharsOnly(obj,chars);
    }
    function IsNumber(obj) {
        var chars = "0123456789";
        return ContainsCharsOnly(obj,chars);
    }



    function IsDay(year, month, day) {
        if (day.length > 2) return false;
        year  = ParseInt(year, 10);
        month = ParseInt(month, 10);
        day   = ParseInt(day, 10);
        if ((day <= 0) || (day > GetEndDay(year, month))) return false;
        return true;
    }
    function IsDay2(day) {
        if (day.length > 2) return false;
        day = ParseInt(day, 10);
        if ((day <= 0) || (day > 31)) return false;
        return true;
    }
    function IsMonth(month) {
        if (month.length > 2) return false;
        month = ParseInt(month);
        if ((month <= 0) || (month > 12)) return false;
        return true;
    }
    function ParseInt(str) {
        return parseInt(str, 10);
    }


	function IsChecked(obj){
	    var count = obj.length;
        var iChecked = 0;
	    if(count > 1){
	        for(var i=0;i<count;i++){
	            if (obj[i].checked) iChecked++;
	        }
	    } else {
	        if (obj.checked) iChecked++;
	    }
        if (iChecked == 0) {            
            return false;
        }
	    return true;
	}


	function LoginMessage(){
		alert("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½ºÀÔ´Ï´Ù.");
		document.location.href = "/aMember/Login.asp?referUrl=" + escape(window.location.pathname + window.location.search);
		return;
	}

	function IfrResize(arg,arg1){
		if(eval(arg1+".document.body.scrollHeight") < 1 ){

			setTimeout("IfrResize('" + arg + "','" + arg1 + "');",500);
		}
		else{
			document.getElementById(arg).style.height = eval(arg1+".document.body.scrollHeight");
			document.getElementById(arg1).height = document.getElementById(arg).style.height;
		}
	}


function runObj(string){
	if(string != undefined)	{
		document.write(string);
	}	
}


function fWriteActivexObject(vDiv,vSrc,vWidth,vHeight){
	var vStrActivex = "";

	if(vDiv == "falsh"){
		vStrActivex += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\"  width=\"583\" height=\"82\">";
		vStrActivex += "   <param name=movie value=\"/aImages/main_menu_navi.swf\">";
		vStrActivex += "   <param name=quality value=high>";
		vStrActivex += "   <param name=\"wmode\" value=\"transparent\">";
		vStrActivex += "   <embed src=\"/aImages/main_menu_navi.swf\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"583\" height=\"82\">";
		vStrActivex += "   </embed>";
		vStrActivex += "</object>";
	}
	if(vDiv == "flash"){
		vStrActivex += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\"  width=\"" + vWidth + "\" height=\"" + vHeight + "\">";
		vStrActivex += "   <param name=movie value=\"" + vSrc + "\">";
		vStrActivex += "   <param name=quality value=high>";
		vStrActivex += "   <param name=\"wmode\" value=\"transparent\">";
		vStrActivex += "   <embed src=\"" + vSrc + "\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"" + vWidth + "\" height=\"" + vHeight + "\">";
		vStrActivex += "   </embed>";
		vStrActivex += "</object>";
	}
	document.write(vStrActivex);
//	alert(vStrActivex);
}

	function fChangeFamilySite(arg,arg1){
		if(arg1 == undefined) arg1 = ""; 
		window.open("/aMember/OutSideLogin.asp?vToSite=" + arg + "&referUrl=" + arg1).focus();
	}


function jfGetObject(objectId){
	if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId); // check W3C DOM
	}
	else if(document.all && document.all(objectID)) {
		return document.all(objectID); // IE4
	}
	else if(document.layers && document.layers[objectID]) {
		return document.layer[objectID]; // NN4
	}
	else {
		return false;
	}
}

function jfSendRequest(vUrl,vReturnFnc){

    try { xmlRequest = new ActiveXObject("Msxml2.XMLHTTP"); }
    catch(e) {
        try { xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); }
        catch(e) {
            try { xmlRequest = new XMLHttpRequest(); }
            catch(e) { xmlRequest = null; }
        }
    }

//	var xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
//	xmlRequest.open("POST", vUrl, true);
	xmlRequest.open("GET", vUrl, true);

	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlRequest.setRequestHeader("Content-length", "0");
//	xmlRequest.onreadystatechange = function() {GetRequest(xmlRequest)};

	xmlRequest.onreadystatechange = function() {eval(vReturnFnc+"(xmlRequest)")};
	xmlRequest.send(null);

	return xmlRequest;
}


function jfCommentLoginCheck(){
	alert(0);

	if(document.getElementById("txtCommentId").value == "" || document.getElementById("txtCommentId").value == "ID"){		
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä");
		document.getElementById("txtCommentId").focus();
		return;
	}
	if(document.getElementById("txtCommentPass").value == "" || document.getElementById("txtCommentPass").value == "PW"){
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä");
		document.getElementById("txtCommentPass").focus();
		return;
	}

	tempNode = document.createElement("FORM");
	tempNode.method ="post";
	tempNode.style.position = "absolute";
	tempNode.style.visibility = "hidden";
	tempNode.style.margin = "0px";
	tempNode.style.left = "-100";
	tempNode.style.top  = "-100";
	tempNode.style.width  = "1";
	document.body.appendChild(tempNode);
	tempNode.innerHTML +="<input name='UserId' id='UserId' value='" + document.getElementById("txtCommentId").value + "'>";
	tempNode.innerHTML +="<input name='UserPassword' id='UserPassword' value='" + document.getElementById("txtCommentPass").value + "'>";
	tempNode.innerHTML +="<input name='referUrl' id='referUrl' value='" + escape(window.location.pathname + window.location.search); + "'>";
	
	tempNode.action="/aMember/LoginProcess.asp";
//	alert(tempNode.innerHTML)
	tempNode.submit();
}



function jfIsNumber(obj) {
	var chars = "0123456789";
	return jfContainsCharsOnly(obj,chars);
}

function jfContainsCharsOnly(obj,chars) {
	for (var inx = 0; inx < obj.value.length; inx++) {
	   if (chars.indexOf(obj.value.charAt(inx)) == -1)
		   return false;
	}
	return true;
}
function jfIsNull(obj) {
	if (obj.value == null || obj.value.replace(/ /gi,"") == "") {
		return true;
	}
	return false;
}

function jfParseInt(str) {
	return parseInt(str, 10);
}




function jfResizeImage(arg,arg1){
	tempObj = document.getElementsByName(arg1);
	for(i=0;i<tempObj.length;i++){
		if(tempObj[i].width > arg){
			tempObj[i].width = arg;
		}
	}
}


function jfResizeImageAll(arg,arg1){
	tempObj = document.getElementsByName(arg1);
	for(i=0;i<tempObj.length;i++){
		if(tempObj[i].width > arg){
			tempObj[i].width = arg;
		}
	}


	tempObj = document.getElementById(arg1); 
	
	var tempImgs = tempObj.getElementsByTagName('IMG');
	
	if(tempImgs == null)return;

	for(i=0;i<tempImgs.length;i++){
		if(tempImgs[i].width > arg){
			tempImgs[i].width = arg;
		}
	}
}




function jfSendScrap(Ttitle,Turl){
	if(document.getElementById("Form_Send_Scrap") == null){
		oNewNode = document.createElement("FORM");
		oNewNode.id="Form_Send_Scrap";
		oNewNode.name="Form_Send_Scrap";
		oNewNode.target ="newPopup";
		oNewNode.method ="post";
		oNewNode.style.position = "absolute";
		oNewNode.style.visibility = "hidden";
		oNewNode.style.margin = "0px";
		oNewNode.style.left = "-100";
		oNewNode.style.top  = "-100";
		oNewNode.style.width  = "1";
		document.body.appendChild(oNewNode);
		oNewNode.innerHTML ="<input name='b_title' id='b_title' value=''><input name='c_url' id='c_url' value=''>";
	}else{
		oNewNode = document.getElementById("Form_Send_Scrap");
	}
	oNewNode.action="/IKY_INC/BoardScrap/popup_scrap_insert.asp";
	oNewNode.b_title.value=Ttitle;
	oNewNode.c_url.value=Turl;
//	newPopup = popup("about:blank","newPopup",400,500);
	newPopup = window.open("about:blank","newPopup","width=400,height=500","status=yes,scrollbars=auto");

	oNewNode.submit();
}


function jfCommentNickNameCheck(){
	if(document.getElementById("txtCommentNickName").value == ""){		
		alert("´Ð³×ÀÓÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä");
		document.getElementById("txtCommentNickName").focus();
		return;
	}

	tempNode = document.createElement("FORM");
	tempNode.method ="post";
	tempNode.style.position = "absolute";
	tempNode.style.visibility = "hidden";
	tempNode.style.margin = "0px";
	tempNode.style.left = "-100";
	tempNode.style.top  = "-100";
	tempNode.style.width  = "1";
	document.body.appendChild(tempNode);

	tempNode.innerHTML +="<input name='user_name' id='user_name' value='" + document.getElementById("txtCommentNickName").value + "'>";
	tempNode.target = "IfrHideProcess";
	tempNode.action="/IKY_INC/BoardTag/nickname_edit.asp";
//	alert(tempNode.innerHTML)
	tempNode.submit();
}


function jfReplaceStr(str, find, replace){
	var pos = 0;
	pos = str.indexOf(find);

	while(pos != -1)
	{
		pre_str = str.substring(0, pos);
		post_str = str.substring(pos + find.length, str.length);
		str = pre_str + replace + post_str;
		pos = str.indexOf(find);
	}
	return str;
}

//--------------<Public Script>

//-->
