// Some Variables
var ItemsClicked = 0;
var itemArray = new Array();

// *****************************************************
//  Login()
// *****************************************************
function doLogin()
{
	var popWidth = 460;
	var popHeight = 190;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popLogin = open('../../../Admin/Login/Admin.Login.asp', 'popLogin', properties);
}
function doMLogin()
{
	var popWidth = 460;
	var popHeight = 190;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popLogin = open('Admin/Login/Admin.Login.asp', 'popLogin', properties);
}
	
//****************************************************************************//
//  function:	doLogout()
// arguments:	none
//    result:	popup window	
//****************************************************************************//
function doLogout()
{
	var popWidth = 460;
	var popHeight = 180;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popLogout = open('../../../Admin/Login/Admin.Logout.asp', 'popLogout', properties);
}
function doMLogOut()
{
	var popWidth = 460;
	var popHeight = 180;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popMLogOut = open('Admin/Login/Admin.Logout.asp', 'popMLogout', properties);
}

// *****************************************************
//  AddNews()
// *****************************************************
function AddNews() {
	var popWidth = 500;
	var popHeight = 407;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle8 = open('Admin/News/News.Add.asp', 'popNewsAdd', properties);
}

// *****************************************************
//  EditNews()
// *****************************************************
function EditNews(pLngNewsID) {
	var popWidth = 500;
	var popHeight = 407;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle9 = open('Admin/News/News.Edit.asp?NewsID='+pLngNewsID, 'popNewsEdit', properties);
}

// *****************************************************
//  DeleteNews()
// *****************************************************
function DeleteNews(pLngNewsID) {
	var popWidth = 460;
	var popHeight = 210;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/News/News.Delete.asp?NewsID='+pLngNewsID, 'popNewsDelete', properties);
}

// *****************************************************
//  AddLinks()
// *****************************************************
function AddLinks() {
	var popWidth = 460;
	var popHeight = 225;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle8 = open('../Admin/Links/Links.Add.asp', 'popLinksAdd', properties);
}

// *****************************************************
//  EditLinks()
// *****************************************************
function EditLinks(pLngLinksID) {
	var popWidth = 460;
	var popHeight = 225;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle9 = open('../Admin/Links/Links.Edit.asp?LinksID='+pLngLinksID, 'popLinksEdit', properties);
}

// *****************************************************
//  DeleteLinks()
// *****************************************************
function DeleteLinks(pLngLinksID) {
	var popWidth = 460;
	var popHeight = 170;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('../Admin/Links/Links.Delete.asp?LinksID='+pLngLinksID, 'popLinksDelete', properties);
}

// *****************************************************
//  ApproveLinks()
// *****************************************************
function ApproveLinks(pLngLinksID) {
	var popWidth = 400;
	var popHeight = 170;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('../Admin/Links/Links.Approve.asp?LinksID='+pLngLinksID, 'popLinksApprove', properties);
}

// *****************************************************
//  refreshOpener()
// *****************************************************
function refreshOpener() {
	window.opener.parent.frames['Frame.Main'].location.reload();
}

// *****************************************************
//  DoAddArticle()
// *****************************************************
function DoAddArticle(pLngArticleID) {
	var popWidth = 562;
	var popHeight = 532;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Articles/Article.Add.asp?ArticleID='+pLngArticleID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoEditArticle()
// *****************************************************
function DoEditArticle(pLngArticleID) {
	var popWidth = 562;
	var popHeight = 532;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Articles/Article.Edit.asp?ArticleID='+pLngArticleID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoDeleteArticle()
// *****************************************************
function DoDeleteArticle(pLngArticleID) {
	var popWidth = 460;
	var popHeight = 170;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
	if (pLngArticleID != 49 && pLngArticleID != 50 && pLngArticleID != 51 && pLngArticleID != 52 && pLngArticleID != 57 && pLngArticleID != 58 && pLngArticleID != 59 && pLngArticleID != 60 && pLngArticleID != 61 && pLngArticleID != 62 && pLngArticleID != 63 && pLngArticleID != 64 && pLngArticleID != 65 && pLngArticleID != 66 && pLngArticleID != 67 && pLngArticleID != 68 && pLngArticleID != 69 && pLngArticleID != 70 && pLngArticleID != 71 && pLngArticleID != 72)
   	    popHandle10 = open('Admin/Articles/Article.Delete.asp?ArticleID='+pLngArticleID, 'popLinksDelete', properties);
   	else
   	    alert('These articles are part of Main Menu and cannot be deleted!');
}

// *****************************************************
//  DoAddMenuItem()
// *****************************************************
function DoAddMenuItem(pLngMenuCatID) {
	var popWidth = 460;
	var popHeight = 195;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/MenuItems/MenuItem.Add.asp?MenuCatID='+pLngMenuCatID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoEditMenuItem()
// *****************************************************
function DoEditMenuItem(pLngMenuItemID,pLngArticleID) {
	var popWidth = 460;
	var popHeight = 195;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/MenuItems/MenuItem.Edit.asp?MenuItemID='+pLngMenuItemID+'&ArticleID='+pLngArticleID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoDeleteMenuItem()
// *****************************************************
function DoDeleteMenuItem(pLngMenuItemID) {
	var popWidth = 460;
	var popHeight = 170;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/MenuItems/MenuItem.Delete.asp?MenuItemID='+pLngMenuItemID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoAddList()
// *****************************************************
function DoAddList(pLngListID) {
	var popWidth = 460;
	var popHeight = 195;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/List/List.Add.asp?ListID='+pLngListID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoEditList()
// *****************************************************
function DoEditList(pLngListID,pStrSource) {
	var popWidth = 460;
	var popHeight = 195;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/List/List.Edit.asp?ListID='+pLngListID+'&Source='+pStrSource, 'popLinksDelete', properties);
}

// *****************************************************
//  DoDeleteList)
// *****************************************************
function DoDeleteList(pLngListID,pStrSource) {
	var popWidth = 460;
	var popHeight = 170;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/List/List.Delete.asp?ListID='+pLngListID+'&Source='+pStrSource, 'popLinksDelete', properties);
}

// *****************************************************
//  DoAddProduct()
// *****************************************************
function DoAddProduct(pLngProductID,pStrSection) {
	var popWidth = 560;
	var popHeight = 695;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=1,height='+popHeight;
	var ProdID = (pStrSection == 'Video') ? 31 : 121;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Products/Product.Add.asp?ProductID='+ProdID+'&Section=' + pStrSection, 'popLinksDelete', properties);
}

// *****************************************************
//  DoEditProduct()
// *****************************************************
function DoEditProduct(pLngProductID,pStrSource,pStrSection) {
	var popWidth = 560;
	var popHeight = 695;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=1,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Products/Product.Edit.asp?ProductID='+pLngProductID+'&ImageID='+pStrSource+'&Section='+pStrSection, 'popLinksDelete', properties);
}

// *****************************************************
//  DoDeleteProduct()
// *****************************************************
function DoDeleteProduct(pLngProductID,pStrSource,pStrSection) {
	var popWidth = 460;
	var popHeight = 170;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Products/Product.Delete.asp?ProductID='+pLngProductID+'&Source='+pStrSource+'&Section='+pStrSection, 'popLinksDelete', properties);
}

// *****************************************************
//  DoAddMedia()
// *****************************************************
function DoAddMedia(pLngMediaID) {
	var popWidth = 560;
	var popHeight = 250;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=1,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Medias/Media.Add.asp?MediaID='+pLngMediaID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoEditMedia()
// *****************************************************
function DoEditMedia(pLngMediaID,pLngImageID) {
	var popWidth = 560;
	var popHeight = 460;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=1,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Medias/Media.Edit.asp?MediaID='+pLngMediaID+'&ImageID='+pLngImageID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoDeleteMedia()
// *****************************************************
function DoDeleteMedia(pLngMediaID) {
	var popWidth = 460;
	var popHeight = 170;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Medias/Media.Delete.asp?MediaID='+pLngMediaID, 'popLinksDelete', properties);
}

// *****************************************************
//  DoImage()
// *****************************************************
function DoImage(pLngProductID,pStrSection) {
	var popWidth = 470;
	var popHeight = 250;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Index/Media.Image.asp?ImageID='+pLngProductID+'&Section=' + pStrSection, 'popLinksDelete', properties);
}

// *****************************************************
//  ToggleValue()
// *****************************************************
function ToggleValue(pLngArticleID) {
	var popWidth = 460;
	var popHeight = 195;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
   	popHandle10 = open('Admin/Articles/Article.Toggle.asp?ArticleID='+pLngArticleID, 'popLinksDelete', properties);
}

// *****************************************************
//  Misc Functions
// *****************************************************
function RefreshOpener()
    {
        window.opener.document.location.reload();
        self.close();
    }
    
function ltrim(argvalue)
    {
        while (1)
            {
                if (argvalue.substring(0, 1) != " ")
                break;
                argvalue = argvalue.substring(1, argvalue.length);
            }
        return argvalue;
    }

function rtrim(argvalue)
    {
        while (1)
            {
                if (argvalue.substring(argvalue.length - 1, argvalue.length) != " ")
                break;
                argvalue = argvalue.substring(0, argvalue.length - 1);
            }

        return argvalue;
    }

function trim(argvalue)
    {
        var tmpstr = ltrim(argvalue);
        return rtrim(tmpstr);
    } 

function FillQuery()
    {
        var Type = document.forms[1].Type[document.forms[1].Type.selectedIndex].text;
        var Brand = document.forms[1].Brand[document.forms[1].Brand.selectedIndex].text;
        var Query = Brand + ' AND "' + Type + '"';
        
        if (Type != '' && Type != '-- Select Type --')
            document.forms[1].Query.value = trim(Query);
        else
			document.forms[1].Query.value = trim(Brand);
    }

/* MODELS OVERVIEW */

function addElement(array,value)
    {
        size = array.length;
        addindex = array.length;
        
        for (var i=array.length+1; i>addindex; i--)
            array[i] = array[i-1];

        array[addindex] = value + '';
        array.length = array.length-1;
        
        //showArray(array);
    }

function deleteElement(array,value)
    {
        size = array.length;
        delindex = arrayPos(array,value);

        for (var i=0; i<=size; i++)
            array[i] = ((i == delindex) ? "delete" : array[i]);
        
        for (var j=delindex; j<size-1; j++)
            if (j != size) array[j] = array[j+1];
                array.length = size-1;

        //showArray(array);
    }

function showArray(array)
    {
        var arraytext = "";
        for (var i = 0; i < array.length; i++)
            arraytext += array[i];

        var lastchar = arraytext.substring(arraytext.length - 1);            
        if (lastchar == ",")
            arraytext = arraytext.substring(0,arraytext.length - 1);

        return arraytext;
    }

function arrayPos(array,value)
    {
        for (var i = 0; i < array.length; i++)
            if (array[i] == value)
                return i;
    }

function inArray(value,array)
    {
        for(i=0;i<array.length;i++)
            if(value.toLowerCase() == array[i].toLowerCase())
                return true;
        return false;
    }

function DoCheck(objChk)
    {
        var objDiv = document.getElementById("Items")

        if (objChk.checked == true)
            {
                ItemsClicked++;
                if (ItemsClicked == 6)
                    {
                        alert('You can only select 5 items to compare.');
                        objChk.checked = false;
                        ItemsClicked--;
                    }
                else
                    addElement(itemArray,objChk.name + ',');
            }
        else
            {
                ItemsClicked--;
                deleteElement(itemArray,objChk.name + ',');
            }

        var oItems = showArray(itemArray);
        var lastchar = oItems.substring(oItems.length - 1);            
        if (lastchar == ",")
            oItems = oItems.substring(0,oItems.length - 1);
        objDiv.value = oItems;
    }
    
function DoSelectOne(objChk)
    {
        var selIndex = document.forms[1].Brand.selectedIndex;
        var selText = document.forms[1].Brand[selIndex].text;
        
        document.forms[1].Query.value = '"' + selText + '"';
        document.forms[1].Type.disabled = objChk.checked;
    }

function DoSelectAll(objChk)
    {
        var selIndex = document.forms[1].Brand.selectedIndex;
        var selText = document.forms[1].Brand[selIndex].text;
        
        if (selText != "_Show All")
            {
                if (objChk.checked)
                    document.forms[1].Query.value = '"' + selText + '"';
                else
                    document.forms[1].Query.value = '';
                document.forms[1].Type.disabled = objChk.checked;
            }
        else
            objChk.checked = false;
    }
    
/*************** QUERYSTRING ********************/

function PageQuery(q)
    {
        if(q.length > 1)
            this.q = q.substring(1, q.length);
        else
            this.q = null;

        this.keyValuePairs = new Array();

        if(q)
            for(var i=0; i < this.q.split("&").length; i++)
                this.keyValuePairs[i] = this.q.split("&")[i];

        this.getKeyValuePairs = function()
            {
                return this.keyValuePairs;
            }
        
        this.getValue = function(s)
            {
                for(var j=0; j < this.keyValuePairs.length; j++)
                    {
                        if(this.keyValuePairs[j].split("=")[0] == s)
                        return this.keyValuePairs[j].split("=")[1];
                    }
                return false;
            }

        this.getParameters = function()
            {
                var a = new Array(this.getLength());
                for(var j=0; j < this.keyValuePairs.length; j++)
                    {
                        a[j] = this.keyValuePairs[j].split("=")[0];
                    }
                return a;
            }
    
        this.getLength = function()
            {
                return this.keyValuePairs.length;
            } 
    }

function queryString(key)
    {
        var page = new PageQuery(window.location.search); 
        return unescape(page.getValue(key)); 
    }

function displayItem(key)
    {
        return queryString(key);
    }

/*************** QUERYSTRING ********************/

function CheckItems()
    {
        var e = document.getElementsByTagName('input');
        var Items = new Array();
        
        if (displayItem('Items') != 'false')
            {
                Items = displayItem('Items').split(',');

                for (var el in e)
                    {
						if (inArray(el,Items))
							{
								var Elem = document.getElementById(el);
								Elem.checked = true;
                                ItemsClicked++;
                                addElement(itemArray,el + ',');
							}
                    }
            }
    }

/* ******** onKeyPress ********* */

function UserLogin() {
	var popWidth = 450;
	var popHeight = 200;
	var leftPosition = (screen.availWidth) ? (screen.availWidth - popWidth) / 2 : 0;
	var topPosition = (screen.availHeight) ? (screen.availHeight - popHeight) / 2 : 0;
	var properties = 'toolbar=0,location=0,scrollbars=0,height='+popHeight;

	properties += ',width='+popWidth+',left='+leftPosition+',top='+topPosition;
	popHandle1 = open('Admin/Login/Admin.Login.asp', 'popCart', properties);
}  

function doKeyPress(e) {
	if (window.event.ctrlKey)
		if (window.event.shiftKey)
			if (window.event.keyCode == 1)
				UserLogin();
}
