taskbars=new Array("صفحه خرید","محیط کار","صفحه فروش","نظرات شما","عضویت در سیستم","جستجو","ورود اعضا","صفحه اخبار","راهنما","مورد نیاز","درباره ما","خروج از سیستم","توضیح سیستم");
iconstext=new Array("سفارش
آنلاین","پس زمینه","فروش
كالا","نظرات
شما","عضو
شوید","جستجو","ورود کاربران","اخبار","راهنما","نیاز شما","درباره ما","خروج","دفتر کار
شما","کالاهای شما");
alertmsg='Right Click Is Not Allowed';
weekdays=new Array("SUN","MON","TUE","WED","THU","FRI","SAT");
baloondefault='Loading ...';
loadingmsg="Loading ...";
exitmsg='آیا میخواهید خارج شوید؟';
basketmsg='کالای مورد نظر شما
به سبد خرید افزوده شد.';
removebasketmsg='کالای مورد نظر شما
از سبد خرید حذف شد.';
//PERSIAN REQUIRED
function submitenter(myfield,e)
{
var key;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
if (key>31)
if (key<128)
{
ss=' !"#$%،گ)(×+و-./0123456789:ك,=.؟@ِذ}ىُىلآ÷ـ،/’د×؛َءٍف‘{ًْإ~جژچ^_پشذزیثبلاهتنمئدخحضقسفعرصطغظ<|>ّ';
if (window.event)
window.event.keyCode=ss.charCodeAt(key-32);
else if (e)
e.which=ss.charCodeAt(key-32);
}
return true;
}
var ajax_result;
var ajax_loading;
function get_Data(url,ajax_result_object,ajax_loading_object)
{
ajax_result = ajax_result_object;
ajax_loading = ajax_loading_object;
d = new Date(); now = d.getTime();
ajax (url, handleInfo);
return false;
}
function handleInfo()
{
if(http.readyState == 1)
{
ajax_loading.style.display = '';
ajax_result.innerHTML = '';
}
if(http.readyState == 4)
{
var response = http.responseText;
ajax_loading.style.display = 'none';
ajax_result.innerHTML = response;
}
}
function createRequestObject()
{
var request_;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer")
{
request_ = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
request_ = new XMLHttpRequest();
}
return request_;
}
var http = createRequestObject();
function ajax ( url, callback )
{
http.open ( 'get', url, true );
http.onreadystatechange = callback;
http.send(null);
}
function showmsg(msg)
{
document.getElementById('balloon').innerHTML=msg;
document.getElementById('balloon').style.filter='alpha(opacity=100)';
document.getElementById('balloon').style.opacity=1;
}
function hidemsg()
{
document.getElementById('balloon').innerHTML='-------';
document.getElementById('balloon').style.filter='alpha(opacity=30)';
document.getElementById('balloon').style.opacity=0.3;
}
function moveballoon(e)
{
document.getElementById('balloon').style.left=MouseX(e);
document.getElementById('balloon').style.top=MouseY(e) - 80;
}
function alert(msg,fmsg)
{
parent.document.getElementById('global_fmsg').innerHTML=fmsg;
parent.document.getElementById('alert_text').innerHTML=msg;
parent.document.getElementById('alertdiv').style.display='';
parent.document.getElementById('disablediv').style.display='';
parent.document.getElementById('disablediv').focus();
}
//GENERAL FUNCTION
function replaceAll(source, findString, replaceString)
{
var result = source;
var i = source.indexOf(findString);
var l1 = findString.length;
while (i >= 0) { result = source.substring(0, i); result += replaceString; result += source.substring(i + l1); source = result; i = source.indexOf(findString); }
return result;
}
function separate(str,separator)
{
s='';
result = new Array();
for (w=0;w<=str.length-1;w++)
{
if (String.fromCharCode(str.charCodeAt(w))!=separator) s+=String.fromCharCode(str.charCodeAt(w));
if (String.fromCharCode(str.charCodeAt(w))==separator) {result.push(s);s='';}
if ((w==str.length-1) && (String.fromCharCode(str.charCodeAt(w))!=separator)) {result.push(s);s='';}
}
return result;
}
function loaddata(newobject,innertag)
{
if (parent.document.getElementById(newobject)!=null) {parent.document.getElementById(newobject).innerHTML=innertag};
}
//SHORTSTR FUNCTIONS
function shortstr(str,strcount,code)
{
result=str;
if (str.length>=strcount)
{
result='';
bool=true;
for (k=0;k<=str.length-1;k++) {if (bool) if ((k==strcount) || (String.fromCharCode(str.charCodeAt(k))=='<')) {result+=" .... (ادامه متن)";bool=false;}result +=String.fromCharCode(str.charCodeAt(k));if (k==str.length-1) result+="";}
}
return result;
}
function continue_click(myobject,code)
{
myobject.style.display='none';
document.getElementById('continue_'+code).style.display='inline';
}
//MOUSE POSITION
function MouseX(event)
{
return (event.pageX || event.x + (parent.document.documentElement.scrollLeft || parent.document.body.scrollLeft));
}
function MouseY(event)
{
return (event.pageY || event.y + (parent.document.documentElement.scrollTop || parent.document.body.scrollTop));
}
function encrypt(str)
{
result = '';
for (i=0;i<=str.length-1;i++)
{
result += str.charCodeAt(i)+1;
if (i < str.length-1) result+='_';
}
return result;
}