/* ================================================ °ø¹é¹®ÀÚ °Ë»ç ================================================ */ String.prototype.isVoid = function (_String){ _String = this != window ? this : _String; var cpReplace = null; cpReplace = _String.replace(/\t\s/gi, '');//ÅÇŰ¿Í CRLFÁ¦°Å cpReplace = _String.replace(/ /gi, ''); //  ¹®ÀÚÁ¦°Å cpReplace = _String.replace(/ /gi, ''); // °ø¹é¹®ÀÚÁ¦°Å if(cpReplace.length) return false; return true; } /* ================================================ ¸Þ´º À̵¿ ÇÔ¼ö goMenu('ȸ¿ø','°¡ÀÔ') Çü½Ä ================================================ */ function goMenu(){ var args = goMenu.arguments, strArgs = ""; var Menu = { "member" : { "mypage" : "http://www.chinahz3.com/mypage/", "join" : "http://www.chinahz3.com/member/", "search" : "http://www.chinahz3.com/member/member.inquiry.php", "modify" : "http://www.chinahz3.com/mypage/mypage.member.modify.php", "logout" : "http://www.chinahz3.com/login/logout_process.php", "login" : "http://www.chinahz3.com/login/" }, "order" : { "cart" : "http://www.chinahz3.com/cart/", "search" : "http://www.chinahz3.com/cart/order_search.php" }, "cscenter" : "http://cscenter.chinahz3.com", "menu" : { "powersale" :"http://www.chinahz3.com/powersale/", "allback" :"http://community.chinahz3.com/list.php?group=Community&code=allbackcoupon", "coupon" :"http://www.chinahz3.com/coupon/", "event" :"http://www.chinahz3.com/event/", "new" :"http://www.chinahz3.com/event/product_list_new.php", "best" :"http://www.chinahz3.com/event/bestProduct.php", "brand" :"http://www.chinahz3.com/brand/", "free" :"http://www.chinahz3.com/event/product_list_free.php", "chance" :"http://www.chinahz3.com/chance/", "wisdom" : "http://www.chinahz3.com/wisdom/", "community": "http://community.chinahz3.com" } } try{ if(args.length == 0){ window.location.href = 'http://www.chinahz3.com'; }else{ for(var i = 0; i < args.length; i++) strArgs += "['"+ args[i] + "']"; var URL = eval("Menu" + strArgs); if(URL == 'undefined'){URL = "/"; } window.location.href=URL; } }catch(e){ } } /* ================================================ ·Î±×ÀÎ ÆäÀÌÁö ================================================ */ function logCheck(){ var form = form = document.forms['loginForm']; if(form.f_user_id.value == ""){ alert('¾ÆÀ̵𸦠ÀÔ·ÂÇϼ¼¿ä'); //form.f_user_id.focus();// window.location.href="http://www.chinahz3.com/login/?loginGoUrl=" + window.location.href; return false; }else if(form.f_user_pass.value == ""){ alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇϼ¼¿ä'); //form.f_user_pass.focus();// window.location.href="http://www.chinahz3.com/login/?loginGoUrl=" + window.location.href; return false; } form.action="http://www.chinahz3.com/login/login_process.php"; } function userLoginCheck(form){ if(form.f_user_id.value == ""){ alert('¾ÆÀ̵𸦠ÀÔ·ÂÇϼ¼¿ä');form.f_user_id.focus();return false; }else if(form.f_user_pass.value == ""){ alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇϼ¼¿ä');form.f_user_pass.focus();return false; } form.action="http://www.chinahz3.com/login/login_process.php"; } /* ================================================ »óǰ °£·« º¸±â ================================================ */ function product_detail_preview(no){ window.open('/search/detail_view.php?product_no=' + no, 'product_detail', 'left='+(screen.width/2-790/2)+',top='+(screen.height/2-200)+',width=790, height=440').focus(); } /* ================================================ ¸Þ´º °ü·ÃÇÔ¼ö ================================================ */ function NavvyNodeVisable(obj, disp){ var tbs = obj.getElementsByTagName('table'); if(tbs.length == 0) return; if(disp == true){ tbs[1].style.display = "block"; tbs[0].childNodes[0].rows[0].cells[1].childNodes[0].src="http://image.chinahz3.com/comm/navvy/navvy_arrow_down_r.gif" }else{ tbs[1].style.display = "none"; tbs[0].childNodes[0].rows[0].cells[1].childNodes[0].src="http://image.chinahz3.com/comm/navvy/navvy_arrow_down.gif" } } /* ================================================ ÄíŰÇÔ¼ö ================================================ */ function setCookie(name, value, hours){ var expire = ""; if(hours != null){ expire = new Date((new Date()).getTime() + hours * 3600000); expire = "; expires=" + expire.toGMTString(); } document.cookie = name + "=" + escape(value) + expire + "; path=/;domain=.chinahz3.com"; } function getCookie(name){ var cookieValue = ""; var search = name + "="; if(document.cookie.length > 0){ offset = document.cookie.indexOf(search); if (offset != -1){ offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; } /* ================================================ °¢ TDÀÇ »ö»óº¯°æ ÇÔ¼ö ================================================ */ function setCellsColor(Row, sColor, sBgColor){ var cells = Row.cells; for(var i = 0; i < cells.length; i++){ cells[i].style.color=sColor; cells[i].style.backgroundColor=sBgColor; } } /* ================================================ ³×ºñ°ÔÀ̼ǿ¡ »ç¿ëµÉ ºÎºÐÀ¸·Î ·¹ÀÌ¾î º¸À̱â, ¼û±è ÇÔ¼ö ================================================ */ function setNavvyEnsureVisible(srcCell, sDisplay){ var tbls = srcCell.getElementsByTagName("Table"); tbls[1].style.display = sDisplay; } /* ================================================ üũ¹Ú½º Àüü ¼±ÅÃ/¼±Åà Ãë¼Ò ÇÔ¼ö ================================================ */ function checkAll(checkValue, targetName){ var objs = document.getElementsByName(targetName); for(var i = 0; i < objs.length;i++){ if(objs[i].getAttribute('type') !='checkbox' || objs[i].getAttribute('disabled') == true) continue; objs[i].checked = checkValue; } } /*======================================================================= AJAX¸¦ °´Ã¼·Î »ý¼ºÇϱâ À§ÇÑ ÇÔ¼ö 1. ±âº» »ç¿ë¹ý var ajax = new Ajax(); ajax.Method = 'POST'; ajax.Action = '/path/ÆäÀÌÁö'; ajax.addParam('Ű', '°ª'); ajax.onError = function(¿À·ùÄÚµå, ¿À·ù¸Þ¼¼Áö){}; ajax.onComplete = function(µ¥ÀÌÅÍ){ó¸®} ajax.submit(); 2. °¢ ¸â¹ö º¯¼ö - XMlHttp : XMLHttpRequest °´Ã¼ - Method : Àü¼Û¹æ½Ä[= 'POST', 'GET'] - Action : ¼­¹ö ÆäÀÌÁö [ URL ] - Parameters : Àü´Þ º¯¼ö(¹è¿­) - ½ÇÁ¦ Á÷Á¢ ÄÁÆ®·ÑÇÒ ÀÛ¾÷ÀÌ ¾øÀ½ - DataType : µ¥ÀÌÅÍ ¼ö½Å ¹æ½Ä[='Text', 'XML'] - Values : »ç¿ëÀÚ Á¤ÀÇ º¯¼ö ¼±¾ðÀ» À§ÇÑ º¯¼ö 3. °¢ ÇÔ¼ö - onLoad : µ¥ÀÌÅÍ Àü¼ÛµÈ ÈÄ ¼­¹ö·Î ºÎÅÍ µ¥ÀÌÅÍ Àü¼ÛÀÌ ¿Ï·áµÇ±â Àü±îÁö À̺¥Æ®(ÇÔ¼ö°´Ã¼) onLoad = ÇÔ¼ö¸í function ÇÔ¼ö¸í(){ document.getElementById('msg').innerHTML = "µ¥ÀÌÅÍ Àü¼Û Áß..."; } - onComplete : µ¥ÀÌÅÍ Àü¼ÛÀÌ ¿Ï·áµÇ´Â ¼ø°£ À̺¥Æ® ¹ß»ý(ÇÔ¼ö°´Ã¼) onComplete = ÇÔ¼ö¸í fuction ÇÔ¼ö(Text = [Text, XML]){ document.getElementById('msg').innerHTML = Text; } - onError : ¿À·ù°¡ ¹ß»ýÇßÀ» °æ¿ì ó¸®ÇÏ´Â ÇÔ¼ö(ÇÔ¼ö°´Ã¼ onError = ÇÔ¼ö¸í fuction ÇÔ¼ö(errno = ¼ýÀÚ, error = ¹®ÀÚ¿­){ alert(errno + " : " + error) } - addParam : ÆÄ¶ó¹ÌÅÍ ÀÔ·Â ÇÔ¼ö addParam('name', 'ajax') - submit() : µ¥ÀÌÅÍ Àü¼Û ÇÔ¼ö =======================================================================*/ function Ajax(){ window.xwzXmlHttp = this; this.XmlHttp = null; this.Method = 'GET'; this.Parameters= new Array(0); this.Action = window.location.href; this.DataType = "Text"; this.Values = new Array(0); this.onLoad = null; this.onComplete = null; this.onError = null; this.addParam = function(Name, Value){this.Parameters[Name] = Value;} this.getParam = function(Name){return this.Parameters[Name];} this.addValue = function(Name, Value){this.Values[Name] = Value;} this.getValue = function(Name){return this.Values[Name];} this.getStatus = function(){ var eventValue = this.XmlHttp.readyState; var Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; return Events[eventValue]; } this.reset = function(){this.Parameters=new Array(0);this.Values =new Array(0);} this.submit = function(){ if(this.XmlHttp != null) this.XmlHttp = null; if(window.ActiveXObject){ try{this.XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{this.XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");}catch(e){} } }else if(window.XMLHttpRequest){ this.XmlHttp = new XMLHttpRequest(); } if(this.XmlHttp == null){ if(this.onError != null && typeof(this.onError) == "function") this.onError(1, "Not install."); return false; } this.XmlHttp.onreadystatechange = function(){ var oXmlHttp = xwzXmlHttp.XmlHttp; if(oXmlHttp.readyState == 4){ if(oXmlHttp.status == 200 && xwzXmlHttp.onComplete != null && typeof(xwzXmlHttp.onComplete) == "function"){ switch(xwzXmlHttp.DataType.toUpperCase()){ case "XML":window.xwzXmlHttp.onComplete(oXmlHttp.responseXML);break; default:window.xwzXmlHttp.onComplete(oXmlHttp.responseText);break; } }else if(oXmlHttp.status != 200){ if(xwzXmlHttp.onError != null && typeof(xwzXmlHttp.onError) == "function") xwzXmlHttp.onError(oXmlHttp.status, oXmlHttp.statusText); } }else if(xwzXmlHttp.onLoad != null && typeof(xwzXmlHttp.onLoad) == "function" ){ xwzXmlHttp.onLoad(oXmlHttp.readyState); } } var TYPE = "text/xml"; var URI = this.Action; var Entry = "", QUERY_STRING = ""; var QUERYS = new Array(0); for(var Name in this.Parameters){Entry=Name+"="+encodeURIComponent(this.Parameters[Name]);QUERYS.push(Entry);} QUERY_STRING = QUERYS.join("&"); if(this.Method.toUpperCase() == 'POST'){ TYPE = "application/x-www-form-urlencoded"; this.XmlHttp.open("POST",URI, true); }else{ if(URI.indexOf("?") === -1) URI += "?" + QUERY_STRING; else URI += "&" + QUERY_STRING; this.XmlHttp.open("GET",URI, true); QUERY_STRING = ""; } this.XmlHttp.setRequestHeader("Content-type", TYPE); this.XmlHttp.setRequestHeader("Cache-Control", "no-cache"); this.XmlHttp.setRequestHeader("Pragma", "no-cache"); this.XmlHttp.send(QUERY_STRING); } } function product_compare(){ var pidx = document.getElementsByName('pIdx[]'); var idx=''; var zidx=0; for(i=0;i

µ«±Û Á¤º¸¸¦ Àоî¿À°í ÀÖ½À´Ï´Ù..."; ajaxRipple.Method ='POST'; ajaxRipple.addParam("Page", nPage); ajaxRipple.addParam("GroupID", GroupID); ajaxRipple.Action = URL; ajaxRipple.onComplete = function(strText){ if(strText.indexOf("Error:") == 0){alert(strText.replace(/Error:/, ''));}else{ document.getElementById("IDS_RIPPLE_LIST").outerHTML = strText; } } ajaxRipple.submit(); } /* ================================================ TOP ½½¶óÀ̵ù ¹è³Ê ½ºÅ©¸³Æ® ================================================ */ var tmClip = null; var nClipDeiffHeight = 10; function clipEffectInit(nIndex, nVisible){ clearTimeout(tmClip);tmClip =null; var div = document.getElementById('id_divs_clip_frame'); var divs = div.getElementsByTagName('div'); if(divs[nIndex].style.visibility=='hidden' || nVisible==true){ divs[0].style.marginTop = parseInt(divs[0].offsetHeight) * -1; divs[1].style.marginTop = parseInt(divs[1].offsetHeight) * -1; divs[nIndex].style.visibility = ''; div.style.position='relative'; div.style.overflow='visible'; div.style.marginBottom='4'; } if(nVisible==true){ divs[nIndex].style.marginTop="0"; div.style.height=parseInt(divs[nIndex].offsetHeight); }else{ var nTop = parseInt(divs[nIndex].style.marginTop); nTop += 2; if(nTop > 0){divs[nIndex].style.marginTop="0";div.style.height=parseInt(divs[nIndex].offsetHeight);return;} divs[nIndex].style.marginTop=nTop;div.style.height=parseInt(divs[nIndex].offsetHeight)+nTop; tmClip=setTimeout("clipEffectInit("+nIndex+")", 10); } } var xwzSwappingToggle = function(byID, nOpacity, nInterval){this.version = '0.9a'; this.sName = '__xwzSwappingToggle__' + byID; this.Layers = new Array(0); this.Coordinates = new Array(0); this.nOpacity =nOpacity || 80; this.bTransfer = false; this.resTmId = null; this.nInterval = nInterval || 30; this.Toggles = new Array(0); this.zIndex = 0; this.bOpacity = false;this.bStop =false;this.setToggle=function(){var S=new Array(0);for(var i=0;i 0 ? i - 1 : this.Layers.length-1;if(i > 0){objTemp = this.Layers[i];this.Layers[i] = this.Layers[j];}else{objTemp = this.Layers[0];for(i = 0; i < this.Layers.length-1;i++) this.Layers[i] = this.Layers[i+1];};this.Layers[j] = objTemp;this.posCalc();}; this.nextTransfer = function(s){if(this.bStop == true)return;var i = 0, j = 0;var objTemp = null; i = this.getIndex(s); j = i < this.Layers.length-1 ? i+1 : 0; if(j > 0 ){objTemp = this.Layers[i];this.Layers[i] = this.Layers[j];}else{objTemp = this.Layers[this.Layers.length-1];for(i = this.Layers.length-1; i > 0; i--) this.Layers[i] = this.Layers[i-1];}; this.Layers[j] = objTemp; this.posCalc();}; this.posCalc = function(){ var dY = 0, dX = 0, posX=0, posY=0; this.Toggles = new Array(0); for(var i =0; i < this.Layers.length; i++){ this.Coordinates[i] = {X : parseInt(posX), Y: parseInt(posY), dX:0, dY : 0}; posY += parseInt( this.Layers[i].offsetHeight ) + 10;dX = this.Coordinates[i].X - parseInt(this.Layers[i].style.left); dY = this.Coordinates[i].Y - parseInt(this.Layers[i].style.top); this.Coordinates[i].dX = dX != 0 ? dX : 0; this.Coordinates[i].dY = dY != 0 ? dY : 0; if(dX != 0 || dY != 0) this.Toggles[this.Toggles.length] = {style:this.Layers[i].style, posX: this.Coordinates[i].X, posY : this.Coordinates[i].Y,distX : dX , distY : dY, gridX :0, gridY : 0}; this.Layers[i].style.zIndex = this.zIndex+ (this.Layers.length-i); }; for(var i = 0; i < this.Toggles.length; i++){ this.Toggles[i].gridX= Math.round( (Math.sin(this.Toggles.length / 30) * Math.PI/2) * this.Toggles[i].distX ); this.Toggles[i].gridY= Math.round( (Math.sin(this.Toggles.length / 30) * Math.PI/2) * this.Toggles[i].distY ); this.Toggles[i].distX= Math.abs(this.Toggles[i].distX); this.Toggles[i].distY= Math.abs(this.Toggles[i].distY); if(this.bOpacity== true) this.Toggles[i].style.filter='alpha(opacity='+this.nOpacity+')';else this.Toggles[i].style['-moz-opacity']=this.nOpacity; };this.setToggle(); this.moveOver(); }; this.moveOver = function(){clearTimeout(this.resTmId); this.resTmId = null; var Toggle = null; var nToggle = this.Toggles.length; for(var i in this.Toggles){ Toggle = this.Toggles[i]; if(Toggle == null){ nToggle--; continue; } Toggle.style.left= (parseInt(Toggle.style.left) + Toggle.gridX)+'px'; Toggle.style.top= (parseInt(Toggle.style.top) + Toggle.gridY)+'px'; Toggle.distX -=Math.abs( Toggle.gridX);Toggle.distY -=Math.abs( Toggle.gridY); if(Toggle.distX <=0) Toggle.style.left=Toggle.posX+'px';if(Toggle.distY <=0) Toggle.style.top=Toggle.posY+'px'; if(Toggle.distY <=0 && Toggle.distX <=0){if(this.bOpacity== true) Toggle.style.filter='alpha(opacity=100)';else Toggle.style['-moz-opacity']=100;nToggle--; this.Toggles[i] = null;}; }; if(nToggle > 0) this.resTmId = setTimeout("window.__xwzSwappingToggle['" + this.sName + "'].moveOver()", this.nInterval);}; this.rePos = function(){var dY = 0, dX = 0, posX=0, posY=0;for(var i =0; i < this.Layers.length; i++){ this.Layers[i].style.height='';this.Coordinates[i] = {X : parseInt(posX), Y: parseInt(posY), dX:0, dY : 0};posY += parseInt( this.Layers[i].offsetHeight ) + 10;};for(var i =0; i < this.Layers.length; i++){this.Layers[i].style.top=this.Coordinates[i].Y;};};if(window.__xwzSwappingToggle==null) window.__xwzSwappingToggle = new Array(0); window.__xwzSwappingToggle[this.sName] = this; this._initializ(byID); }; function clipEffectAction(Action){ clearTimeout(tmClip);tmClip =null; var div = document.getElementById('id_divs_clip_frame'); var divs = div.getElementsByTagName('div'); var nHgt = parseInt(divs[1].offsetHeight) * -1; var nTop = parseInt(divs[0].style.marginTop); if(Action =='up'){ nTop -= 10; if(nTop < nHgt){ //try{/*div.filters[0].motion='reverse';*/div.filters[0].apply();divs[0].style.marginTop=parseInt(divs[0].offsetHeight)* -1;divs[1].style.visibility='visible';divs[1].style.marginTop = 0;div.filters[0].play();} divs[0].style.marginTop=parseInt(divs[0].offsetHeight) * -1; divs[1].style.marginTop = 0; divs[1].style.visibility='visible';divs[0].style.visibility='hidden'; div.style.height=parseInt(divs[1].offsetHeight) return; } }else{ if(nTop < nHgt){ //try{/*div.filters[0].motion='forward';*/div.filters[0].apply();nTop = nHgt;divs[1].style.visibility='hidden';divs[1].style.marginTop = nHgt;div.filters[0].play();} divs[1].style.marginTop = nHgt; divs[0].style.visibility='visible';divs[1].style.visibility='hidden'; nTop = nHgt; } nTop +=10; if(nTop > 0){divs[0].style.marginTop = 0;div.style.height=parseInt(divs[0].offsetHeight);return;} } divs[0].style.marginTop = nTop; div.style.height=parseInt(divs[0].offsetHeight) + nTop ; tmClip=setTimeout("clipEffectAction('"+Action+"')", 10); } function showDetailDiary(obj, key){ var oPanel = document.getElementById('xwzDetailPanel_' + key); //oPanel.style.left = 84; oPanel.style.display="block"; } function hiddenDetailDiary(obj, key){ document.getElementById('xwzDetailPanel_' + key).style.display="none"; }