if(typeof netcontrols == "undefined") netcontrols = new Object();

netcontrols.globals = function() {}

netcontrols.globals.prototype = {
	
	preloadImages: function(arrimg) {
        if (document.images) {
            for (i=0; i<arrimg.length; i++) {
				this.newImage(arrimg[i]);            
			}
	   }
    },
	
	newImage: function(img) {
        if (document.images) {
            rslt = new Image();
            rslt.src = img;
            return rslt;
        }
    },
	
	getEditorContent: function(editor_name) {
		var oEditor = FCKeditorAPI.GetInstance(editor_name) ;
		if (oEditor.EditorDocument.body.innerHTML) {
			return oEditor.EditorDocument.body.innerHTML;
		}
		else return "";
	},
	
	protectEmail: function(em1, em2, name) {
		var at = String.fromCharCode(64);
		if (name.length==0) {
			name = em1+at+em2;
		}
		txt = "<a href=\"mailto:"+em1+at+em2+"\">"+name+"</a>";
		document.write(txt);
	},
	
	newWindow: function(Url, PageName, Width, Height, Center, Xpos, Ypos, Scrollbars, Resizable) {
        if (Center == true) {
            Xpos = (screen.availWidth-Width)/2;
            Ypos = (screen.availHeight-Height)/2;
        }
        if (Xpos == null) {Xpos = 0;}
        if (Ypos == null) {Ypos = 0;}
        if (Scrollbars == null) {Scrollbars = 0;}
        if (Resizable == null) {Resizable = 0;}
        var Features = "";
        Features += "toolbar=0" 
            + ",location=0" 
            + ",status=1" 
            + ",menubar=0" 
            + ",scrollbars=" + Scrollbars 
            + ",resizable=" + Resizable
            + ",width=" + Width 
            + ",height=" + Height
            + ",left=" + Xpos 
            + ",top=" + Ypos;
        var w = window.open(Url, PageName, Features);
        w.focus();        
    },
	
	showHideLayer: function(item) {
		item = document.getElementById(item);
		if (item.style.display=="none") {
			item.style.display = "block";
		}
		else {
			item.style.display = "none";
		}
	}
	
}

