﻿var sURL = unescape(window.location.pathname);
function Refresh()
{
    window.location.replace( sURL );
}
function PopupImage(image)
{
    imageWindow = window.open(image, 'newWindow', 'resizable=yes,width=400,height=400');
    imageWindow.moveTo(self.screen.width/3, self.screen.height/4);
}
function DownloadDocument(id)
{
    documentWindow = window.open('/iSystem.NET/DocumentDownload.aspx?id='+id, 'newWindow');
}
function objGet(x)
{
	if (typeof x != 'string') return x;
	else if (Boolean(document.getElementById)) return document.getElementById(x);
	else if (Boolean(document.all)) return eval('document.all.'+x);  // pro MSIE 4
	else return null;
}
function objSetStyle (obj,prop,val)
{
	var o = objGet(obj);
	if (o && o.style)
	{
		eval ('o.style.'+prop+'="'+val+'"');
		return true;
	}
	else return false;
}
function objDisplay (obj,on,type)
{
	if (on && !type) type = 'block';
	return objSetStyle(obj,'display',(on) ? type:'none');
}
function objShow (obj,on)
{
	return objSetStyle(obj,'visibility',(on) ? 'visible':'hidden');
}
function trim(stringToTrim)
{
    return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim)
{
    return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim)
{
    return stringToTrim.replace(/\s+$/,"");
}
function iif(condition, truePart, falsePart)
{
    if (condition)
    {
        return truePart;
    }
    else
    {
        return falsePart;
    }
}
