var MyCookie = {
    Write:function(name,value,days) {
        var D = new Date();
        D.setTime(D.getTime()+86400000*days)
        document.cookie = escape(name)+"="+escape(value)+
            ((days == null)?"":(";expires="+D.toGMTString()))
        return (this.Read(name) == value);
    },
    Read:function(name) {
        var EN=escape(name)
        var F=' '+document.cookie+';', S=F.indexOf(' '+EN);
        return S==-1 ? null : unescape(     F.substring(EN=S+EN.length+2,F.indexOf(';',EN))    );
    }
}


function SetLang ( Lang )
{
  	document.formLang.SetLang.value = Lang;
  	document.formLang.submit();
}

function doReload()
{
	window.location.reload ( true );
}

function WinClose ()
{
 	window.opener.doReload();
 	window.close();
}

function PrintPage ()
{
 if (typeof(window.print) != 'undefined')
 {
     window.print();
 }
}

function addslashes(str) {
 str=str.replace(/\'/g,'\\\'');
 str=str.replace(/\"/g,'\\"');
 str=str.replace(/\\/g,'\\\\');
 str=str.replace(/\0/g,'\\0');
 return str;
}

function stripslashes(str) {
 str=str.replace(/\\'/g,'\'');
 str=str.replace(/\\"/g,'"');
 str=str.replace(/\\\\/g,'\\');
 str=str.replace(/\\0/g,'\0');
 return str;
}