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;
}