﻿//---------------- MISC

dt.flyouts();

function global() {
}

function showLinkAlert(_txt) {
    var _alert = dt.alert.show("copy and past this link<br><textarea id=linkareacontent rows=1 style=width:95%>" + _txt + "</textarea>");
    var _textarea = document.getElementById('linkareacontent');
    _textarea.select();
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function DeleteItem(url){
    if(confirm("Are you sure you want to delete this?")){
        window.location.href=url;
    }
}

function DeleteItemBool(url){
    return confirm("Are you sure you want to delete this?");
}

function DeleteParentItem(url){
    if(confirm("WARNING: Deleting this top level item will also delete all children below it.\n\n Are you sure you want to proceed?")){
        window.location.href=url;
    }
}