function OpenBrWindow(theURL,winName,features, myWidth, myHeight) { if(window.screen){ var myLeft = (screen.width-myWidth)/2; var myTop = (screen.height-myHeight)/2; features+=(features!='')?',':''; features+=',left='+myLeft+',top='+myTop; } var t = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight); t.focus(); } function mainmenu(){ if($("#nav").length > 0){ $("#nav ul").css({display: "none"}); $("#nav li").hover( function(){ var target = $(this).find('ul:first'); if(target.length>0){ target.css({visibility: "visible",display: "none"}).show(); if ( jQuery.browser.msie && jQuery.browser.version < 7) { target.bgiframe(); } } },function(){ var target = $(this).find('ul:first'); if(target.length>0){ target.css({visibility: "hidden"}); if ( jQuery.browser.msie && jQuery.browser.version < 7) { target.bgiframe(); } } }); }else if($(".mainmenu tr:first a").length>0){ $(".mainmenu tr:first ul").css({display: "none"}); $(".mainmenu tr:first").find("a") .hover(function(){ var target = $(this).parent().find('ul:first'); if(target.length>0){ target.css({visibility: "visible",display: "none"}).show(); } },function(){ var target = $(this).parent().find('ul:first'); if(target.length>0){ target.css({visibility: "hidden"}); } }) .end() .find("ul") .hover(function(){ var target = $(this).parent().find('ul:first'); if(target.length>0){ target.css({visibility: "visible",display: "none"}).show(); } },function(){ var target = $(this).parent().find('ul:first'); if(target.length>0){ target.css({visibility: "hidden"}); } }); } } function submenu(){ if($('#subFuncNav li:even').length>0){ $('#subFuncNav li:even').addClass("bg"); } } function rolemenu(){ if($('#rolenav ul').length>0){ $('#rolenav ul').hide(); $('#rolenav ul:first').show(); $('#rolenav li:even').addClass("bg"); $('#rolenav li img').click( function() { window.location.href = "#top"; var checkElement = $(this).next(); if((checkElement.is('ul')) && (checkElement.is(':visible'))) { return false; } if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $('#rolenav li img').each(function(i,val) { var menuHeaderImg = $(val).attr("src").replace("close","open"); $(val).attr( "src" , menuHeaderImg ); }); $(this).attr( "src" , $(this).attr("src").replace("open","close") ); $('#rolenav ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } } ); } if($("#menuUserType").length>0 && $("#menuUserType").val().length>0){ if(document.getElementById("menuUserType").value.indexOf("visitor")>-1){ $('#rolenav ul').hide(); $('#rolenav ul:first').show(); $('#rolenav li img').each(function(i,val) { var menuHeaderImg = $(val).attr("src").replace("close","open"); $(val).attr( "src" , menuHeaderImg ); }); if($('#visitorImg').attr("src") != null){ var temp = $('#visitorImg').attr("src").replace("open","close"); $('#visitorImg').attr("src", temp); } } if(document.getElementById("menuUserType").value.indexOf("exhibitor")>-1){ $('#rolenav ul').hide(); $('#rolenav ul:eq(1)').show(); $('#rolenav li img').each(function(i,val) { var menuHeaderImg = $(val).attr("src").replace("close","open"); $(val).attr( "src" , menuHeaderImg ); }); if($('#exhibitorImg').attr("src") != null){ var temp = $('#exhibitorImg').attr("src").replace("open","close"); $('#exhibitorImg').attr("src", temp); } } if(document.getElementById("menuUserType").value.indexOf("press")>-1){ $('#rolenav ul').hide(); $('#rolenav ul:eq(2)').show(); $('#rolenav li img').each(function(i,val) { var menuHeaderImg = $(val).attr("src").replace("close","open"); $(val).attr( "src" , menuHeaderImg ); }); if($('#pressImg').attr("src") != null){ var temp = $('#pressImg').attr("src").replace("open","close"); $('#pressImg').attr("src", temp); } } } } function fixIE7(){ var userAgent = window.navigator.userAgent.toLowerCase(); // 修正 jQuery.browser.version 比對問題 $.browser.version = (userAgent.match( /.(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0, '0'])[1]; var version = $.browser.version; if(version=="7.0"||version=="6.0"){ $(function() { var zIndexNumber = 1000; $('div').each(function() { $(this).css('zIndex', zIndexNumber); zIndexNumber -= 10; }); }); } } function doPage(i){ if($("#pageForm").length > 0){ $("#pageForm input[name=currentPage]").val(i); $("#pageForm").submit(); }else{ alert("PageForm can't found."); } } function doChangePageSize(i){ if($("#pageForm").length > 0){ $("#pageForm input[name=pageSize]").val(i); $("#pageForm input[name=currentPage]").val(1); $("#pageForm").submit(); }else{ alert("PageForm can't found."); } } function doChangeOrderType(sort){ if($("#pageForm").length > 0 && $("#pageForm input[name=orderType]").length > 0){ $("#pageForm input[name=orderType]").val(sort); $("#pageForm").submit(); }else{ alert("PageForm can't found."); } } function doChangeAlbum(albumID){ if($("#pageForm").length > 0){ //$("#pageForm input[name=albumID]").val(albumID); $("#pageForm").submit(); }else{ alert("PageForm can't found."); } } function doChangePhoto(windowName, photoPath, photoName, isHorizontal, lang, currentPhoto){ var temp = ""; if(currentPhoto > 3){ //var left = photoSize * (currentPhoto-3); //document.getElementById("pictb").style.left = "-" + left + "px"; } var tempPhotoPath = photoPath.replace("-2.", "\."); if(isHorizontal == "Y"){ temp = ''+photoName+''; }else if(isHorizontal == "N"){ temp = ''+photoName+''; }else{ temp = ''+photoName+''; } document.getElementById("currentPhotoName").innerHTML = photoName; document.getElementById("photoImage").innerHTML = temp; } var photoSize = 128; function doPhotoLeft(){ var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", ""); if(value != "0"){ value = Math.abs(parseInt(value) - photoSize); value = "-"+value+"px"; document.getElementById("pictb").style.left = value; } } function doPhotoRight(photoNum){ var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", ""); if(parseInt(value) != (photoNum - 5)*photoSize && photoNum >= 5){ value = parseInt(value) + photoSize; value = "-"+value+"px"; document.getElementById("pictb").style.left = value; } } function setPhotoWidth(photoNum, currentPhoto){ if(currentPhoto > 3){ var left = photoSize * (currentPhoto-3); document.getElementById("pictb").style.left = "-" + left + "px"; } var width = photoSize * photoNum; document.getElementById("pictb").style.width = width + "px"; } var prodPhotoSize = 112; function doProdPhotoLeft(){ var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", ""); if(value != "0"){ value = Math.abs(parseInt(value) - prodPhotoSize); value = "-"+value+"px"; document.getElementById("pictb").style.left = value; } } function doProdPhotoRight(photoNum){ var value = document.getElementById("pictb").style.left.replace("-", "").replace("px", ""); if ((parseInt(value) != (photoNum - 7)*prodPhotoSize) && photoNum > 7) { value = parseInt(value) + prodPhotoSize; value = "-"+value+"px"; document.getElementById("pictb").style.left = value; } } function setProdPhotoWidth(photoNum){ var value = prodPhotoSize * photoNum; document.getElementById("pictb").style.width = value + "px"; } $(document).ready(function(){ mainmenu(); rolemenu(); submenu(); if($("#idmenu").length > 0){ rolemenu4(); } fixIE7(); var url = new Array(); url[0] = "product/list.html"; url[1] = "product/index/list.html"; url[2] = "product/info.html"; url[3] = "exh/list.html"; url[4] = "exh/info.html"; url[5] = "exh/search.html"; url[6] = "index.html"; url[7] = "/"; var currentURL = ""+document.location.href; currentURL = currentURL.replace(window.location.protocol + "//" + window.location.hostname,""); var idx = currentURL.indexOf("?"); if(idx>-1){ currentURL = currentURL.substring(7,idx); }else if(currentURL.length>7){ currentURL = currentURL.substring(7); } for(var i=0;i 0 ? result.substring(1) : ""; } } }; FormUtil.Message = {}; FormUtil.MessageQueue = new Array(); FormUtil.Message = function (obj, message){ var span = document.createElement("span"); span.innerHTML = " " + message + ""; try{ var parent; if(obj.selected!=undefined){ parent = obj.parentNode; parent.appendChild(span); }else if(obj.length!=undefined && obj.length>0 && obj[0].checked!=undefined){ parent = obj[0].parentNode; parent.appendChild(span); }else if(obj.parentNode!=undefined){ parent = obj.parentNode; parent.appendChild(span); }else{ /* reserved for Deng */ obj.wrapAll(""); obj.after(" " + message + ""); } FormUtil.MessageQueue.push(span); }catch(E){ alert(E); } try{ obj.focus(); }catch(e){ } }; FormUtil.MessageReset = function (){ var queue = FormUtil.MessageQueue; for(var i=0; i=0; i--){ if(from.options[i].selected){ from.options[i] = null; } } } function removeSelectedOptions(obj){ for (var i=(obj.options.length-1); i>=0; i--){ var o = obj.options[i]; if (o.selected){ obj.options[i] = null; } } } function getAllSelectedValues(obj){ var result = ""; for(var i=0; i-1){ }else{ document.getElementById("myFuncList").style.display = "block"; document.getElementById("myFuncList").innerHTML = response; } } }); } function downloadPhoto(windowName, showLang, path){ var now = new Date(); tb_show(windowName, "/"+showLang+"/act/album/photo/downloadForm.html?path="+path, false, "keepThis=true&TB_iframe=true&height=230&width=750"); } var BoxTool = {}; BoxTool.mode = "colorbox"; BoxTool.open = function (title, url, width, height) { $.fn.colorbox({title:title, href:url, open:true, iframe:true, overlayClose:false, width:width, height:height}); }; BoxTool.close = function () { $.fn.colorbox.close(); }; BoxTool.callback = parent;