function ShowEl(id){
    var el=document.getElementById(id);
    if(el!=null) el.style.display='block';
}

function HideEl(id){
    var el=document.getElementById(id);
    if(el!=null) el.style.display='none';
}

function GetSubElementById(id, tag){
    var os=document.getElementsByTagName(tag);
    var i;
    for(i=0;i<os.length;i++)
        if(os[i].id != null && os[i].id.indexOf("_" + id) > 0)
            return os[i];
    return null;
}

function GoPage(str){
    document.location.href="/page.aspx"+document.location.search+"&diary="+str;
}

function GoDiary(num, qs, cid){
    document.location.href="/diary.aspx?cid=" + cid + "&num=" + num + qs;
}

function GoPageDac(str){
    setCookie("diary",str,1)
    document.location.href="/page.aspx?cid=r3.dac";
}

function setCookie(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+"="+escape(value)+";expires="+exdate+";path=/";
}
function NoPage()
{
    var hd=GetSubElementById("hdPage","input");
    if(hd!=null)hd.value="";
}

function OpenHistoric(pid) {
  var strFeatures="height=350,width=600,left=170,top=300,status=yes,toolbar=no,menubar=no,location=no,status=no,menubar=no,titlebar=no";
  window.open("/history.aspx?pid=" + pid,"",strFeatures,"true");
}