<!--

	function MM_swapImgRestore () {
		var i, x, a= document.MM_sr;
		for(i=0; a && i<a.length && (x=a[i]) && x.oSrc; i++) x.src = x.oSrc;
	}

	function MM_swapImage () {
		var i, j=0, x, a=MM_swapImage.arguments;
		document.MM_sr=new Array;

		for(i=0; i < (a.length-2); i+=3) if ((x=MM_findObj(a[i]))!=null) {
			document.MM_sr[j++] = x;
			if(!x.oSrc) x.oSrc = x.src;
			x.src = a[i+2];
		}
	}

	function MM_findObj (n, d) {
		var p,i,x;
		if (!d) d=document;
		if ((p=n.indexOf("?")) > 0 && parent.frames.length) {
			d=parent.frames[n.substring(p+1)].document;
			n=n.substring(0,p);
		}
		if (!(x = d[n]) && d.all) x = d.all[n];
		for (i=0; !x && i < d.forms.length; i++) x = d.forms[i][n];
		for (i=0; !x && d.layers && i<d.layers.length; i++) x = MM_findObj (n,d.layers[i].document);
		if (!x && document.getElementById) x = document.getElementById(n);
		return x;
	}

	function trim(st) {
		while(st && st.indexOf(" ")==0) st = st.substring(1);
		while(st && st.lastIndexOf(" ")==st.length-1) st = st.substring(0, st.length-1);
		return st;
	}

	function allTrim(checkform) {
		var i=0;
		while (i < checkform.length) {
			checkform.elements[i].value=trim(checkform.elements[i].value);
			i++;
		}
	}

	function formatNumber(str) 
	{
		str=str.toString();
		str=str.replace(/\D/g,"");
		l=str.length-3;
		while(l>0) {
			if (str.substr(0,l) == '-') { l-=3; continue;}
			str=str.substr(0,l)+","+str.substr(l);
			l-=3;
		}
		return str;
	}

	function formatNumberD(str,flag1,flag2) //(ÀÔ·Â°ª, 3ÀÚ¸®¸¶´Ù ½°Ç¥ »ç¿ë¿©ºÎ, *.00(¼¾Æ®) »ðÀÔ¿©ºÎ)
	{
		str=centFormat(str,1,flag2); 
		l=str.length-3;
		if(str.indexOf(".")!=-1) l-=3;
		if(!flag1){
			while(l>0) {
				str=str.substr(0,l)+","+str.substr(l);
				l-=3;
			}
		}
		return str;	
	}

	function centFormat(str,flag1,flag2)  //(ÀÔ·Â°ª, ¸®ÅÏ°ªÀÇ float Å¸ÀÔ»ç¿ë¿©ºÎ, *.00(¼¾Æ®) »ðÀÔ¿©ºÎ)
	{
		str=str.toString();
		str=str.replace(/[^0-9.]/g,""); // ¼ýÀÚ¸¸ ÀÔ·Â
		var temp1 = 0;
		var temp2 = str.length;

		temp1 = str.indexOf(".");
		if (temp1==-1) { if(!flag2) {temp1 = 0; str = str + ".00";}  }
		else
		{
			temp = temp2 - temp1;	
			if (temp1 != 0 && temp == 2) str = str + "0";
			else str = str.substr(0,temp1+3);
		}	
		if(flag1) return str;
		else return parseFloat(str);
		
	}

	function toDollorFormat(str) {
		return formatNumberD(centFormat(str));
	}

	function extractComma(str){
		str=str.replace(/\D/g,"");
		return str;
	}

	function extractCommaOnly(str){
		str=str.replace(/,/g,"");
		return str;
	}

	function inputNumCheck(target) {
		return true;

		if (event.keyCode!=37 && event.keyCode!=39 && event.keyCode!=8) {
			target.value=extractComma(target.value);
		}
	}


	function isCheck(field,message){
		var count = 0;
			for(var i=0; i<field.length; i++){
				if (field[i].checked == true){	
					count += 1;
				}							
			}
			if(count == 0){					
				alert(message);
				return false;			
			}
	}

	function chkNum(oField) { 
		var valid = "0123456789"
		var bFlag = false; 
		var temp; 		
			for (var i=0; i<oField.value.length; i++) { 
				temp = "" + oField.value.substring(i, i+1); 
				if (valid.indexOf(temp) == "-1") bFlag = true; 
			} 
			if (bFlag) {
				alert("ÇØ´ç Ç×¸ñÀº ¹Ýµå½Ã Á¤¼ö¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
				oField.value = "";
				oField.focus();
				return false;
			}
			return true;
	}

	function isNull(field,message) {
		if (field.value.length==0) {
			alert(message);
			field.focus();
			return false;
		}
		return true;
	}

	function lengthen(strIn) {
		strOut = String(strIn);
		if (strOut.length==1) strOut = "0" + strOut;
		return strOut;
	}

	function converttime(year, month, day, hour, minute, second) {
		month--; // the month begin from 0(January) in Javascript
		var today = new Date();
		var year1 = 0;
		dKR = new Date(year, month, day, hour, minute, second, 0);
		dGMT = new Date(dKR.getTime() + (-540 * 60 * 1000));
		dLocal = new Date(dGMT.getTime() - (today.getTimezoneOffset() * 60 *1000));
		var returnString;
		returnString  = lengthen(dLocal.getMonth()+1);
		returnString += "/";
		returnString += lengthen(dLocal.getDate());
		returnString += "/";
                year1 = dLocal.getYear();
                if (dLocal.getYear() < 200) year1 = year1 + 1900;
                returnString += year1;
		returnString += "<BR>";
		returnString += lengthen(dLocal.getHours());
		returnString += ":";
		returnString += lengthen(dLocal.getMinutes());
		returnString += ":";
		returnString += lengthen(dLocal.getSeconds());

		if (dLocal.getYear() == today.getYear() && dLocal.getMonth() == today.getMonth() && dLocal.getDate() == today.getDate()) {
			returnString = "<font color=#A00020>" + returnString + "</font>";
		}
		return returnString;
	}

	function converttime2(year, month, day, hour, minute, second) {
		month--; // the month begin from 0(January) in Javascript
		var today = new Date();
		var year1 = 0;
		dKR = new Date(year, month, day, hour, minute, second, 0);
		dGMT = new Date(dKR.getTime() + (-540 * 60 * 1000));

		dLocal = new Date(dGMT.getTime() - (today.getTimezoneOffset() * 60 *1000));

		var returnString;
		returnString  = lengthen(dLocal.getMonth()+1);
		returnString += "/";
		returnString += lengthen(dLocal.getDate());
		returnString += "/";
		year1 = dLocal.getYear();
		if (dLocal.getYear() < 200) year1 = year1 + 1900;
		returnString += year1;

		if (dLocal.getYear() == today.getYear() && dLocal.getMonth() == today.getMonth() && dLocal.getDate() == today.getDate()) {
			returnString = "<font color=#A00020>" + returnString + "</font>";
		}
		return returnString;
	}

	function addList(object, text, value) {
		loc=object.length;
		object.options[loc] = new Option(text,value);
		// object.selectedIndex = loc;
	}

	function onchange_select_product(product_value, sph_hidden_value, up) {
		if (trim(product_value)=='') {
			up.innerText = '';
			tp.innerText = '';
			sph_hidden_value.value = 0;
			execute();
			return false;
		}

		var id_price = product_value.split("^");
		up.innerHTML = '$' + toDollorFormat(id_price[1].toString());
		document.getElementById('tp').innerHTML = '$' + toDollorFormat(id_price[1].toString());
		sph_hidden_value.value = id_price[1];
		execute();
	}

	function onback(form) {
		var i=0, pid=0;

		while (i < form.elements.length) {
			if (form.elements[i].type=='text' && form.elements[i].name.substring(0,3)=='qty') {
				pid = form.elements[i].name.substring(4);
				onkeyup_qty(form.elements[i], eval('pricepolicy_'+pid), eval('document.all.up_'+pid), eval('document.all.sp_'+pid), eval('form.uph_'+pid), eval('form.sph_'+pid), 1);
			}

			i++;
		}

		i=0;

		while (i < form.elements.length) {
			if (form.elements[i].name.substring(0,14)=='select_product') {
				pid = form.elements[i].name.substring(14);
				onchange_select_product(form.elements[i].value, eval('document.all.sph_'+pid), eval('document.all.up'+pid));
			}

			i++;
		}
	}


//Cookie Start
	function setCookie (name, value, expires, path, domain, secure) {
		// cookie string
		var cs = name + "=" + escape(value) + ( (path) ? "; path=" + path : "")   + ( (expires) ? "; expires=" + expires.toGMTString() : "") + ( (domain) ? "; domain=" + domain : "") + ( (secure) ? "; secure" : "");
			document.cookie = cs;
		//document.cookie = "faq_hash=h; path=/; domain=test.netsarang.com;";
	}
	
	function getDelayDay(day) {
		expires = new Date();
		expires.setTime(expires.getTime() + 24 * 60 * 60 * day * 1000);
		return expires;
	}
	
	
	function getCookie (name) {
	
		// cookie string
		var cs = document.cookie;
		var prefix = name + "=";
		
		// cookie's Start Index of the information of it.
		var cSI = cs.indexOf(prefix);
		if (cSI == -1) {
			return null;
		}
		
		// Find cookie's End Index of the information of the cookie.
		var cEI = cs.indexOf(";", cSI + prefix.length);
		
		// If it din't find the CEI, then set it to the end of the cs
		if (cEI == -1) {
			cEI = cs.length;
		}
		// Decode the value of the cookie's
		return unescape(cs.substring(cSI + prefix.length, cEI));		
	}


	function deleteCookie (name, path) 
	{
		setCookie (name, "", "", path )

		//var expires = new Date();
		//var value = getCookie(name);
		//document.cookie = name + "=" + value + "; expires=" + (expires.toGMTString() - 1000);
	}	
	//Cookie Stop


	function byte_length(input) 
	{ 
			var i, j=0; 
			for(i=0;i<input.length;i++) { 
				val=escape(input.charAt(i)).length; 
				if(val==  6) j++; 
				j++; 
			} 
			return j; 
	} 



	//ºÎµ¿¼Ò¼öÁ¡ °è»ê ÇÔ¼ö ½ÃÀÛ
	//(float) function float_math(string)
	function float_math(val) // ¿¬»êÀÇ ÀçÁ¤ÀÇ
	{
		var math_flag = new Array();
		var make_val="";
		for(var i=0; i<val.length; i++)
		{
			var temp_str=val.charAt(i);
			if(temp_str.search(/[\-||\+||\*||\/]/g)!=-1)
			{
				math_flag.push(temp_str);
				make_val=make_val.concat("^");
			}
			else make_val=make_val.concat(temp_str);
		}

		var temp_arr=make_val.split("^");
		for(var i=0;i<math_flag.length;i++)
		{
			var input_val=new Array();
			if(!result) var result=temp_arr[i];
			input_val.push(result.toString());
			input_val.push(temp_arr[i+1].toString());
			result=float_math_query(input_val, math_flag[i]);
		}
		return parseFloat(result);
	}
	
	function float_math_query(val_arr, math_flag) // ½ÇÁ¦ °è»ê
	{
		var val_arr_length=val_arr.length;
		var point_length = new Array();
		var point_max_length=-1;
		for(var j=0; j<val_arr_length;j++)
		{
			var val=val_arr[j];
			var point_temp=-1;
			var point=false;
			for(var i=0; i<val.length; i++)
			{
				var temp=val.charAt(i);
				if(temp.search(/[\\.]/g)!=-1) point=true;
				if(point==true) point_temp++;
			}
			if(point_max_length < point_temp)	 point_max_length=point_temp;
			val_arr[j]=val_arr[j].replace(/[\\.]/g,"");
			if(val.length>1) val_arr[j]=val_arr[j].replace(/^[0]/g,"");
			point_length.push(point_temp);
		}

		var in_zero="";
		for(var i=0;i<point_max_length;i++) in_zero=in_zero.concat("0");
		var return_zero=in_zero;

		var return_math;
		for(var i=0;i<val_arr_length;i++)
		{
			var temp_zero;
			if(point_length[i]!=-1) temp_zero=in_zero.substring(point_length[i]);
			else temp_zero=in_zero;

			if(i==0) return_math=parseInt(val_arr[i].concat(temp_zero));
			else
			{
					if(math_flag=="+") return_math=return_math+parseInt(val_arr[i].concat(temp_zero));
					else if(math_flag=="-") return_math=return_math-parseInt(val_arr[i].concat(temp_zero));
					else if(math_flag=="*")
					{
						return_math=return_math*parseInt(val_arr[i].concat(temp_zero));
						return_zero=return_zero.concat(in_zero);
					}
					else if(math_flag=="/")
					{
						return_math=return_math/parseInt(val_arr[i].concat(temp_zero));
						var flag="";
					}
			}
		}
		if(!flag) return_math=return_math/parseInt("1"+return_zero);
		return parseFloat(return_math);
	}
	//ºÎµ¿¼Ò¼öÁ¡ °è»ê ÇÔ¼ö ³¡

	function move_page(obj, link)
	{
		var cut_link=link.indexOf("?");
		var action_link;
		if(cut_link>-1)
		{
			action_link=link.substring(0,cut_link);
			var parameter=(link.substring(cut_link+1)).split("&");
			
			for(var i=0;i<parameter.length;i++)
			{
				var cut_point=parameter[i].indexOf("=");
				var key=parameter[i].substring(0,cut_point);	
				if(parameter[i].length>(key.length +1))
				{
					var val=parameter[i].substring(cut_point+1);

					if(key=="manager") val=eval("document.all.manager_"+val+".value");
					if(key=="condition") val=eval("document.all.condition_"+val+".value");
					if(eval("obj."+key)) eval("obj."+key).value=val;
					else	obj.innerHTML+="<input type=hidden name='"+key+"' value='"+val+"'>";
				}
			}
			
		}else action_link=link;	
		obj.action=action_link;
		obj.submit();
	}


	function visible_change(obj)
	{
		if(obj.style.display =="none") 	obj.style.display ="block";
		else obj.style.display ="none";
	}


	//ÆäÀÌÁö ÀÌµ¿ ÇÔ¼ö
	function AnchorPosition(ei)
	{
		var ot=ei.offsetTop;
		while((ei=ei.offsetParent) != null) { ot += ei.offsetTop; }
		document.body.scrollTop=ot;
	}


	//Clipboard ÀúÀå±â´É
	function copyToClipboard(In_txt)
	{
			document.body.focus();
			if(window.clipboardData) 
			{
				var clipInput, clipContainer;
				clipInput = document.createElement("textarea");
				clipInput.style.width = "0px";
				clipInput.style.height = "0px";
				clipInput.style.borderStyle = "none";
				clipContainer = document.createElement("div");
				clipContainer.style.position = "absolute";
				clipContainer.style.width = "0px";
				clipContainer.style.height = "0px";
				clipContainer.style.display = "none";
				clipContainer.style.zIndex = "-100";
				clipContainer.appendChild(clipInput);
				document.body.appendChild(clipContainer);
				clipInput.value = In_txt;
				clipContainer.style.display = "";
				clipInput.focus();
				clipInput.select();
			}
			else if(navigator.userAgent.indexOf("Safari") != -1)
			{	
				var clipFrame = document.getElementById("clipboardFrame");
				if (!clipFrame)
				{ 
					clipFrame = document.createElement("iframe");
					clipFrame.id = "clipboardFrame";
					clipFrame.style.display = "none";
					document.body.appendChild(clipFrame);

					var clipDoc = clipFrame.contentDocument;
					clipDoc.body.innerHTML = "<textarea id='clipContainer'/>";
					clipDoc.designMode = "On";
					clipDoc.body.contentEditable = true;
				}
				var clipDoc = clipFrame.contentDocument;
				var container = clipDoc.getElementById("clipContainer");
				container.value = In_txt;
				container.focus();
				container.select();
			}
			else if (window.netscape) return;
	}


function getImgSize(imgSrc)
{
var newImg = new Image();
newImg.src = imgSrc;
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);
}


-->
