﻿function SitemapControl()
{
}

SitemapControl.openInPopUp = function(url, width, height)
{
    if (width == null)
    {
        width = 650;
    }
    
    if (height == null)
    {
        height = 750;
    }
    
	var xOffset = (window.screenLeft + (document.body.clientWidth / 2)) - width / 2;
	var yOffset = (window.screenTop + (document.body.clientHeight / 2)) - height / 2 - 30;
	
	var winOpts =
	    'toolbar=no,' +
	    'menubar=no,' +
	    'scrollbars=yes,' +
	    'location=no,' +
	    'resizable=yes,' +
	    'status=no,' +
	    'width=' + width + ',' +
	    'height=' + height;
	    
	var win = window.open(
	    url,
	    'popup',
	    winOpts);
	    
	win.focus();
}

/*this.sitemapstyler = function()
{
    var sitemap = document.getElementById("sitemap")
    if (sitemap)
    {
        this.listItem = function(li)
        {
            if (li.getElementsByTagName("ul").length > 0)
            {
	            var ul = li.getElementsByTagName("ul")[0];
	            ul.style.display = "none";
	            var span = document.createElement("span");
	            span.className = "collapsed";
	            span.onclick = function()
	            {
		            ul.style.display = (ul.style.display == "none") ? "block" : "none";
		            this.className = (ul.style.display == "none") ? "collapsed" : "expanded";
	            };
	            li.appendChild(span);
            };
        };
		
        var items = sitemap.getElementsByTagName("li");
        for (var i = 0; i < items.length; i++)
        {
            listItem(items[i]);
        };
		
    };	
};
window.onload = sitemapstyler;*/
