// assign global object to prostores variable
var ProStores;
if (!ProStores)
    ProStores = {};

ProStores.namespace = function() {
    
    for (var i = 0; i < arguments.length; ++i) {
        var aParts = arguments[i].split(".");
        var objCurrentObject = ProStores;

        // ProStores is implied, so it is ignored if it is included
        for (var j = (aParts[0] == "ProStores") ? 1 : 0; j < aParts.length; ++j) {
            objCurrentObject[aParts[j]] = objCurrentObject[aParts[j]] || {};
            objCurrentObject = objCurrentObject[aParts[j]];
        }
    }
};

ProStores.ListenOnEvent = function(strEvent, fcn) {
	 if (window.addEventListener)
		window.addEventListener(strEvent, fcn, false);
	 else if (document.addEventListener)
		document.addEventListener(strEvent, fcn, false);
	 else if(window.attachEvent)
		 window.attachEvent("on" + strEvent, fcn);
};

function createBookmark() {
	if (window.sidebar) // Mozilla Firefox Bookmark
		window.sidebar.addPanel(document.title, location.href, '');
	else if (window.external) // IE Favorite
		window.external.AddFavorite(location.href, document.title);
	else // all others
		alert("Please press CTRL+D to bookmark this page.");
}