function Browser() { var ua, s, i; this.isIE = false; // Internet Explorer this.isOP = false; // Opera this.isNS = false; // Netscape this.version = null; ua = navigator.userAgent; s = "Opera"; if ((i = ua.indexOf(s)) >= 0) { this.isOP = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } s = "MSIE"; if ((i = ua.indexOf(s))) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; } } var browser = new Browser(); function dokeydown(event,obj1,str1){ if (event.keyCode == 13){ switch (str1) { case "news": newssearch(obj1); break; case "products": productssearch(obj1); break; default : break; } } } function changetypesid(str1){ document.forms[0].action='news_index.asp?TYPESID=' + str1; donochange(); } function changeprice(){ document.forms[0].WHICHONE.value='1'; document.forms[0].action='product_list.asp'; donochange(); } function newssearch(obj1){ if (obj1.value!='請輸入關鍵字'){ document.forms[0].action='news_index.asp'; donochange(); }else{ alert('請輸入關鍵字'); obj1.focus(); obj1.select(); } } function productssearch(obj1){ if (obj1.value!='請輸入關鍵字'){ document.forms[0].WHICHONE.value='1'; document.forms[0].action='product_list.asp'; donochange(); }else{ alert('請輸入關鍵字'); obj1.focus(); obj1.select(); } } function donochange(){ document.forms[0].ckda.value='1'; document.forms[0].submit(); } function changenewspage(str1){ document.forms[0].PAGE.value=str1; donochange(); } function closepopproduct(){ document.getElementById("xx").style.visibility='hidden'; if(browser.isIE&&browser.version=='6'){ if (document.getElementById("xx").iframeEl != null){ document.getElementById("xx").iframeEl.style.display = "none"; } } } function getDocWidth(){ return (document.all? getTrueBody().scrollLeft+getTrueBody().clientWidth : pageXOffset+window.innerWidth-15); } function getDocHeight(){ return (document.all? Math.min(getTrueBody().scrollHeight, getTrueBody().clientHeight) : Math.min(window.innerHeight)); } function getTrueBody(){ return ( (!window.opera && document.compatMode && document.compatMode!="BackCompat") || window.opera)? document.documentElement : document.body } function showpopproduct(obj1,str1,str2){ var x=0; var y=0; if(browser.isIE&&browser.version=='6'){ x += obj1.offsetLeft; x += obj1.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft; }else{ x += obj1.offsetLeft; x += obj1.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetParent.offsetLeft; x += obj1.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft; } if(x>(getTrueBody().clientWidth/2)){ x -= 250; }else{ x += obj1.offsetWidth; } y += obj1.offsetTop; y += obj1.offsetParent.offsetTop; y += obj1.offsetParent.offsetParent.offsetTop; y += obj1.offsetParent.offsetParent.offsetParent.offsetTop; y += obj1.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop; y += obj1.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetTop; var popupElement = document.getElementById("xx"); popupElement.innerHTML = '

' + str2 + '

'; popupElement.style.left = x+"px" popupElement.style.top = y+"px" if(browser.isIE&&browser.version=='6'){ if (popupElement.iframeEl == null){ var iframeEl = document.createElement("IFRAME"); iframeEl.frameBorder = 0; iframeEl.src = "javascript:false;"; iframeEl.style.display = "none"; iframeEl.style.position = "absolute"; iframeEl.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"; popupElement.iframeEl = popupElement.parentNode.insertBefore(iframeEl, popupElement); popupElement.iframeEl.style.left = "0px"; popupElement.iframeEl.style.top = "0px"; popupElement.iframeEl.style.width = popupElement.style.width; popupElement.iframeEl.style.height = popupElement.style.height; popupElement.iframeEl.style.zIndex = "9998"; } if (popupElement.iframeEl != null){ popupElement.iframeEl.style.left = popupElement.style.left; popupElement.iframeEl.style.top = popupElement.style.top; popupElement.iframeEl.style.width = 250; popupElement.iframeEl.style.height = 280; popupElement.iframeEl.style.display = ""; } } document.getElementById("xx").style.visibility='visible'; } function setHeight(sheight){ if(document.getElementById("xproductleftmenu")){ document.getElementById("xproductleftmenu").height=sheight; }else{ if (document.embeds.length!=0){ for (i=0;i'; s+=''; s+=''; s+=''; s+=''; document.getElementById("xx").style.left = ((getDocWidth() - 320) / 2) + "px"; document.getElementById("xx").style.top = ((getDocHeight() - 240) / 2) + getTrueBody().scrollTop + "px"; document.getElementById("xx").innerHTML = s; document.getElementById("xx").style.visibility='visible'; } function closeflv(){ document.getElementById("xx").innerHTML = ''; document.getElementById("xx").style.visibility='hidden'; } function changeproductpics(obj1,sf1,sf2,sf3){ var x1 = ''; var x2 = ''; var x3 = ''; x1 = document.forms[0].xFILE1.value; x2 = document.forms[0].xFILE2.value; x3 = document.forms[0].xFILE3.value; document.getElementById("xPIC0").innerHTML = ''; document.forms[0].xFILE1.value = sf1; document.forms[0].xFILE2.value = sf2; document.forms[0].xFILE3.value = sf3; obj1.innerHTML = ''; } function anteaterAddFavorites(WEB_SITE_TITLE,WEB_SITE_HREF) { var _title = (WEB_SITE_TITLE == "") ? document.title : WEB_SITE_TITLE; var _locationHref = (WEB_SITE_HREF == "") ? window.location.href : WEB_SITE_HREF; if( window.sidebar && window.sidebar.addPanel ) { // Gecko (Netscape 6) window.sidebar.addPanel( _title, _locationHref, '' ); } else if( window.external ) { // IE window.external.AddFavorite( _locationHref, _title ); } else if( document.layers ) { // NS4 window.alert( 'Please click OK then press Ctrl+D to create a bookmark' ); } else { // Other browsers window.alert( 'Please use your browsers\' bookmarking facility to create a bookmark' ); } } function anteaterAddBookmark(WEB_SITE_TITLE,WEB_SITE_HREF,pType){ var _locationHref = (WEB_SITE_HREF == "") ? window.location.href : WEB_SITE_HREF; _locationHref = encodeURIComponent(_locationHref); var _title = (WEB_SITE_TITLE == "") ? document.title : WEB_SITE_TITLE; _title = encodeURIComponent(_title); var _href; switch (pType) { case 'FAVORITES': anteaterAddFavorites(WEB_SITE_TITLE,WEB_SITE_HREF); return; break; case 'FACEBOOK': _href = "http://www.facebook.com/sharer.php?u="+ _locationHref + "&t=" + _title; break; case 'GOOGLE': _href = "http://www.google.com/bookmarks/mark?op=add&bkmk="+ _locationHref + "&title=" + _title; break; case 'PLURK': _href = "http://www.plurk.com/?qualifier=shares&status=".concat(_locationHref).concat(' ').concat('(').concat(_title).concat(')'); break; case 'TWITTER': _href = "http://twitter.com/home/?status=" + _title + " " + _locationHref; break; } window.open( _href , "_blank" ); return false; }