
// Copyright (C) 2003 by Netphoria, Inc. All Rights Reserved.

// writeemail will write the email address to the page
function writeemail(username, domain) {
	document.write( username + '@' + domain )
}

// writecloakedmailto will write a mailto link to the page.
// if linktext = "email" then the email address is written cloaked, otherwise linktext is written
function writecloakedmailto(username, domain, linktext) {
	document.write('<a href=\"mailto:' + username + '@' + domain + '\">');
	if (linktext == "email")	{ document.write(username + '@' + domain + '</a>') }
	else 						{ document.write(linktext + '</a>') }
}

// cloakmailto can be used in href to cloak a mailto like this:
// javascript:cloakmailto("hosting","netphoria.com?subject=hosting")
// This is safe to use with pages that can be edited by ACE  
function cloakmailto(username, domain) {
	window.location = "mailto:" + username + '@' + domain
}


// BT 09-10-03 commented out probably not used anymore
//function aceFILE_openWindow(theURL,winName,features) { //v1.0
//	var t = '?http_referer=' + document.URL
//	var w = window.open(theURL + t,winName,features)
//	if (w.opener == null) {
//		w.opener = window;
//		}
//	else {
//		w.focus()
//	}
//}


function ace_newWindow(url,windowName, features) {
	var link = window.open(url,windowName,features);
}


function aceDB_openWindow(theURL,winName,features) { //v1.0
	
	if (theURL.indexOf("windowName=") < 0) {
		if (theURL.indexOf("?") > 0) {
			theURL = theURL + "&";
		} else {
			theURL = theURL + "?";
		}
		theURL = theURL + "windowName=" + window.name;
	}

	if (theURL.indexOf("http_referer=") < 0) {
		if (theURL.indexOf("?") > 0) {
			theURL = theURL + "&";
		} else {
			theURL = theURL + "?";
		}
		theURL = theURL + "http_referer=" + escape(document.URL);
	}
	
	//alert(theURL);
	var w = window.open(theURL,winName,features)
	if (w.opener == null) {
		w.opener = window;
		}
	else {
		w.focus()
	}
}

function writeYear() {
	oneDate = new Date();
	var theYear = oneDate.getYear();
	if (theYear < 200 ) { theYear = theYear + 1900 } // Y2K fix
	document.write(theYear);
}

//<!--  Begin ACE Link --------------------------------------------------------------------------->

//window.name='acePageWindow'
function MM_openBrWindow(theURL,winName,features) { //v1.0
	
	if (theURL.indexOf("windowName=") < 0) {
		if (theURL.indexOf("?") > 0) {
			theURL = theURL + "&";
		} else {
			theURL = theURL + "?";
		}
		theURL = theURL + "windowName=" + window.name;
	}
	
	var w = window.open(theURL,winName,features)
	if (w.opener == null) {
		w.opener = window;
		}
	else {
		w.focus()
	}
}

//<!--  End ACE Link ---------------------------------------------------------------------------->

function TellAFriend() {
	window.location.href = "/n-tellafriend/index.asp?page=" + escape(document.URL)
}

function jsTellAFriend() {
	window.location.href = "mailto:?subject=Check%20out%20this%20site&body=" + escape(document.URL)
}


