﻿
onerror=handleErr
var method;

function handleErr(msg,url,l)
{
    txt="Line Number="+ l  + "$#$#Errormessage=" + msg + " $#Method Name=" + method +"$#$# URL:" + url;
    ClickHandler.LogError(txt);
    return true
}


function LogOut()
{
    method = "LogOut";
    ClickHandler.LogOut()
}

function ClearText(Identity)
{
    method = "ClearText";
    var obj =null;
    if(parent.frames["description"].document !=null)
        obj=parent.frames["description"].document.getElementById(Identity);
    if(obj != null)
    {
        var val=obj.innerHTML;
        if(val.indexOf("Lorem ipsum dolor sit amet") != -1)
            obj.innerHTML="";
        ReflectDescriptionStyle();
    }
}

function setChanged(event)
{
    method = "setChanged";
    ClickHandler.SetChanged();
}



/*------------------------------------ */
/* methods for Permission checking -- by sudeep */
/*------------------------------------ */

function checkPermission(permName, showErrorMessage) {
    if (typeof showErrorMessage == "undefined") {
        showErrorMessage = true;
    }
    var result = CMSPermissions.CheckUserPermission(permName);    
    if (result.value == false) {
        parent.frames["description"].hideLoading();
        
        if (showErrorMessage)
            alert('Sorry, you don\'t have permission to use this feature.');
    }
        
    return result.value;   
   
   
}
