/*
[destoon b2b system] copyright (c) 2008-2010 destoon.com
this is not a freeware, use is subject to license.txt
*/
var dmurl = document.location.protocol+'//'+location.hostname+(location.port ? ':'+location.port : '')+'/';
var ajpath = 'ajax.asp';
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 $() {
var elements = new array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string') element = document.getelementbyid(element);
if (arguments.length == 1) return element;
elements.push(element);
}
return elements;
}
var tid=0;
function tab(id) {
var ttab=$('tab'+tid);
var ttabs=$('tabs'+tid);
var tab=$('tab'+id);
var tabs=$('tabs'+id);
if(id!=tid) {
ttab.classname='tab';
tab.classname='tab_on';
ttabs.style.display='none';
tabs.style.display='';
tid=id;
try{$('tab').value=id;}catch(e){}
}
}
function checkall(form) {
form = $(form);
for(var i = 0; i < form.elements.length; i++) {
var e = form.elements[i];
if(e.type != 'checkbox') continue;
e.checked = e.checked ? false : true;
}
}
function stoinp(str, id, sp) {
var sp = sp ? sp : ',';
var arr = $(id).value.split(sp);
for (var i=0; i