function CMSBookmarkPage()
{
	var url = window.location.href;
	var title = window.title;
	
	if (window.external) //IE
	{
		window.external.AddFavorite(url, title);
	} else {
		alert("Your browser does not support automatic bookmark creation.\nPlease use your browser menu or keyboard shortcut:\nIn Firefox:  <CTRL> + D\nIn Opera:  <CTRL> + T");
	}
}

function CMSPrintPage()
{
	window.print();
}

function CMSSendToAFriend(subject)
{
	var subjectText = new String(subject);
	if (subjectText.length == 0) {
		subjectText = "I found this and thought you may be interested.";
	}
	
	var bodyText = "I found this and thought you may be interested: " + window.location.href;
	
	var location = "mailto:?subject=" + subjectText + "&body=" + bodyText;
	window.location.href = location;
}

function CMSSdMaMs(uSDMAMS, dSDMAMS)
{
	var m = "mailto:" + uSDMAMS + "@" + dSDMAMS;
	if (arguments.length == 3) {
		m += "?subject=" + arguments[2];
	}
	window.location.href = m;
}

function CMSOpenMap(mapUrl)
{
	var name = "_blank";
	var features = "location=no,menubar=yes,directories=no,toolbar=yes,status=yes,resizable=yes,scrollbars=yes";

	//Set the window size (window automatically centered by this function)
	var height = 370;
	var width = 470;
	
	var screenHeight = window.screen.height;	
	var screenWidth = window.screen.width;
	var top = parseInt((screenHeight - height) / 2);
	var left = parseInt((screenWidth - width) / 2);
	features += ",top=" + top + "px";
	features += ",left=" + left + "px";
	features += ",width=" + width + "px";
	features +=",height=" + height + "px";
	
	window.open(mapUrl, name, features);
}

function BindEvent(bindingObject, bindingEvent, boundDelegate)
{
	try
	{
		var bindingEventValue = new String(bindingEvent);
		if (bindingObject.attachEvent)
		{
			bindingObject.attachEvent(bindingEvent, boundDelegate);
		} 
		else if (bindingObject.addEventListener) 
		{
			bindingEventValue = bindingEventValue.toLowerCase().replace("on", "");
			bindingObject.addEventListener(bindingEventValue, boundDelegate, false);
		}
	} catch (e) {}
}

function onFlashOverClose(){
	document.getElementById("flashOver_container").style.display = "none";
}

function registerNS(ns)
{
 var nsParts = ns.split(".");
 var root = window;

 for(var i=0; i<nsParts.length; i++)
 {
  if(typeof root[nsParts[i]] == "undefined")
   root[nsParts[i]] = new Object();

  root = root[nsParts[i]];
 }
}

registerNS("CMS.Modules.ExternalLinkDisclaimer");
CMS.Modules.ExternalLinkDisclaimer = function() {
	var public = {
	    CurrentDestination: null,
	    
		Execute: function(href) {
			CurrentDestination = href;
			linkAlert(href);
		},
		
		GetDestination: function() {
		    return CurrentDestination;
		}
	};
	
	return public;
}();
