/* [Destoon B2B System] Copyright (c) 2008-2011 Destoon.COM This is NOT a freeware, use is subject to license.txt */ var isIE = (document.all && window.ActiveXObject && !window.opera) ? true : false; var isGecko = navigator.userAgent.indexOf('WebKit') != -1; var DMURL = document.location.protocol+'//'+location.hostname+(location.port ? ':'+location.port : '')+'/'; if(isIE) try {document.execCommand("BackgroundImageCache", false, true);} catch(e) {} var xmlHttp; var Try = { these: function() { var returnValue; for (var i = 0; i < arguments.length; i++) {var lambda = arguments[i]; try {returnValue = lambda(); break;} catch (e) {}} return returnValue; } } function makeRequest(queryString, php, func, method) { xmlHttp = Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ); method = (typeof method == 'undefined') ? 'post' : 'get'; if(func) xmlHttp.onreadystatechange = eval(func); xmlHttp.open(method, method == 'post' ? php : php+'?'+queryString, true); xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttp.send(method == 'post' ? queryString : null); } function Dd(i) {return document.getElementById(i);} function Ds(i) {Dd(i).style.display = '';} function Dh(i) {Dd(i).style.display = 'none';} function Df(i) {Dd(i).focus();} var tID=0; function Tab(ID) { var tTab = Dd('Tab'+tID); var tTabs = Dd('Tabs'+tID); var Tab = Dd('Tab'+ID); var Tabs = Dd('Tabs'+ID); if(ID!=tID) {tTab.className='tab'; Tab.className='tab_on'; tTabs.style.display='none'; Tabs.style.display=''; tID = ID; try{Dd('tab').value=ID;}catch(e){}} } function checkall(f, t) { var t = t ? t : 1; for(var i = 0; i < f.elements.length; i++) { var e = f.elements[i]; if(e.type != 'checkbox') continue; if(t == 1) e.checked = e.checked ? false : true; if(t == 2) e.checked = true; if(t == 3) e.checked = false; } } function stoinp(s, i, p) { if(Dd(i).value) { var p = p ? p : ','; var a = Dd(i).value.split(p); for (var j=0; j '+str+sound('tip');Dd(i).focus();}catch(e){} window.setTimeout(function(){Dd('d'+i).innerHTML = '';}, t); } function Inner(i,s) {try {Dd(i).innerHTML = s;}catch(e){}} function InnerTBD(i,s) {try {Dd(i).innerHTML = s;} catch(e) {Dd(i).parentNode.outerHTML=Dd(i).parentNode.outerHTML.replace(Dd(i).innerHTML,s);}} function confirmURI(m,f) {if(confirm(m)) Go(f);} function Go(u) {window.location = u;} function showmsg(m, t) { var t = t ? t : 5000; var s = m.indexOf(L['str_delete']) != -1 ? 'delete' : 'ok'; try{Dd('msgbox').style.display = '';Dd('msgbox').innerHTML = m+sound(s);window.setTimeout('closemsg();', t);}catch(e){} } function closemsg() {try{Dd('msgbox').innerHTML = '';Dd('msgbox').style.display = 'none';}catch(e){}} function sound(f) {return '
';} function Eh(t) { var t = t ? t : 'select'; if(isIE) { var arVersion = navigator.appVersion.split("MSIE"); var IEversion = parseFloat(arVersion[1]); if(IEversion >= 7 || IEversion < 5) return; var ss = document.body.getElementsByTagName(t); for(var i=0;i= 7 || IEversion < 5) return; var ss = document.body.getElementsByTagName(t); for(var i=0;i 1; } } function ext(v) {return v.substring(v.lastIndexOf('.')+1, v.length);} function set_cookie(n, v, d) { var e = ''; var f = d ? d : 365; e = new Date((new Date()).getTime() + f * 86400000); e = "; expires=" + e.toGMTString(); document.cookie = CKPrex + n + "=" + v + ((CKPath == "") ? "" : ("; path=" + CKPath)) + ((CKDomain =="") ? "" : ("; domain=" + CKDomain)) + e;} function get_cookie(n) { var v = ''; var s = CKPrex + n + "="; if(document.cookie.length > 0) { o = document.cookie.indexOf(s); if(o != -1) { o += s.length; end = document.cookie.indexOf(";", o); if(end == -1) end = document.cookie.length; v = unescape(document.cookie.substring(o, end)); } } return v; } function del_cookie(n) {var e = new Date((new Date()).getTime() - 1 ); e = "; expires=" + e.toGMTString(); document.cookie = CKPrex + n + "=" + escape("") +";path=/"+ e;} function substr_count(str, exp) {if(str == '') return 0;var s = str.split(exp);return s.length-1;} function lang(s, a) {for(var i = 0; i < a.length; i++) {s = s.replace('{V'+i+'}', a[i]);} return s;} document.onkeydown = function(e) { var k = typeof e == 'undefined' ? event.keyCode : e.keyCode; if(k == 37) { try{if(Dd('destoon_previous').value && typeof document.activeElement.name == 'undefined')Go(Dd('destoon_previous').value);}catch(e){} } else if(k == 39) { try{if(Dd('destoon_next').value && typeof document.activeElement.name == 'undefined')Go(Dd('destoon_next').value);}catch(e){} } else if(k == 38 || k == 40 || k == 13) { try{if(Dd('search_tips').style.display != 'none' || Dd('search_tips').innerHTML != ''){SCTip(k);return false;}}catch(e){} } else if(k == 27) { try{if(Dd('Dtop') != null) cDialog();}catch(e){} } }