﻿function QueryString(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i=0;i<gy.length;i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}
function ShowMessage(message)
{
    alert(message);
}
function ShowResult(jsonResult) {
    if (jsonResult.Status) {
        if (jsonResult.ShowMessage) {
            alert(jsonResult.Message);
        }
    }
}
Array.prototype.remove = function(from, to) {
    var rest = this.slice((to || from) + 1 || this.length);
    this.length = from < 0 ? this.length + from : from;
    return this.push.apply(this, rest);
};
Array.prototype.HasItem = function(item) {
    var originalArray = this;
    var j = 0;
    while (j < originalArray.length) {
        if (originalArray[j] == item) {
            return true;
        } else { j++; }
    }
    return false;
}

Array.prototype.RemoveItem = function(item) {
    originalArray = this;
    var j = 0;
    while (j < originalArray.length) {
        // alert(originalArray[j]);
        if (originalArray[j] == item) {
            originalArray.splice(j, 1);
        } else { j++; }
    }
    // assert('hi');
    return originalArray;
}
function PageRedirect(newUrl) {
    //alert(newUrl);
    window.location = newUrl;
}



