
function SaveUserRating(ratingControl, newValue)
{
    ratingControl.switchMask(false);
    document.getElementById(hdnSelectedRating).value = newValue;
    __doPostBack('ctl00$MainBody$btnUpdateRating','');
    return false;
}
function VerifySelection(strMessage){      
if( GetCheckedCount('chkRowSelect') == 0){
alert(strMessage) 
return false;
}
else return true;
}
function ConfirmRemove(){
if( GetCheckedCount('chkRowSelect') == 0){
alert('Please select one or more items to remove.') 
return false;
}
else if(!confirm('Are you sure you want to remove ' + GetCheckedCount('chkRowSelect') + ' Item(s) from the collection?')) return false;
return true;
}
function ConfirmDelete(){
if( GetCheckedCount('chkRowSelect') == 0){
alert('Please select one or more items to delete.') 
return false;
}
else if(!confirm('Deleting items will remove them permanently from iTaggit system. Are you sure you want to delete ' + GetCheckedCount('chkRowSelect') + ' Item(s)?'))return false;
return true;
}
function ConfirmQuarantine(){
if(GetCheckedCount('chkRowSelect') == 0){
alert('Please select one or more items to quarantine.');
return false;
}
else if(!confirm('Do you wish to quarantine access of ' + GetCheckedCount('chkRowSelect') + ' Item(s)?'))return false;
return true;  
}
// This function is used to display the place-holder images in case the default
// image is not found on the server.
function NoImage(objImage){objImage.src = "/Images/NoImage.gif"}
function ShowAddToCollectionMsg(){var hdnatc=document.getElementById(hdnAddToCollection);if(hdnatc==null)return;if(hdnatc.value.length>0){alert(hdnatc.value);hdnatc.value='';}}
function ShowRemoveItemMsg(){var hdnrt=document.getElementById(hdnRemoveItem);if(hdnrt==null)return;if(hdnrt.value.length>0){alert(hdnrt.value);hdnrt.value='';}}


function ViewTrackingDetail(ObjectID,ObjectType,ViewType)
{
    Telligent_Modal.Configure('/utility/loading.html',['CommonModal'],['CommonModalTitle'],['CommonModalClose'],['CommonModalContent'],['CommonModalFooter'],['CommonModalResize'],['CommonModalMask'],100);
    Telligent_Modal.Open('/Items/Graphs/ItemViewTracking.aspx?ObjectID=' + ObjectID + '&ObjectType=' +  ObjectType + '&ViewType=' + ViewType,510,242,null)
    return false;
}

function ConfirmClone()
{
if(GetCheckedCount('chkRowSelect') == 0){
alert('Please select one or more items to clone.');
return false;
}
else if(!confirm('Do you wish to clone ' + GetCheckedCount('chkRowSelect') + ' selected Item(s)?'))return false;
return true;  
}

function ShowBulkCloneMsg(){var hdnbcm=document.getElementById(hdnCloneItems);if(hdnbcm==null)return;if(hdnbcm.value.length>0){alert(hdnbcm.value);hdnbcm.value='';}}

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ShowAddToCollectionMsg);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ShowRemoveItemMsg);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ShowBulkCloneMsg);
