// Scripts for Per4manceTraining.com
// Script development, compilation nd modification 
// by Newclear Designs | Nigel M. Duckworth
// Jan 02, 2005

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/******************************* spamproof email links v1.3  [ Nigel Duckworth ]  ******************************
//   v1.3 January 14, 2004 | Nigel Duckworth
//
//   ENHANCEMENTS
//   Added domain suffix support and made link text a variable instead of 
//   using the actual email address (addr + '@' + dom) in case developer wants 
//   "Click Here" instead of "info@onenetwork.com".
//
//   INSTRUCTIONS
//   To use this script, place the following 
//   code in place of the email address:
//   < s c r i p t >email('prefix','domain','suffix','Subject Of Email','linktext')< / s c r i p t >
//   e.g.:
//   instead of: info@spamcop.net
//   use: < s c r i p t >email('info','spamcop','net','This is Spam','Click To Report Spam')< / s c r i p t >
**************************************************************************************************************/

function email(pre,dom,suf,subj,linktext) {
	var dom = dom + '.' + suf;		
	var em = pre + '@' + dom;
	var emlink = '<' + 'a ' + 'h' + 'ref' + '="' + 'ma' + 'il' + 'to:' + pre + '@' + dom;
	// determine if subject has been defined, if not supply default subject
	if ((subj == undefined) || (subj == null)) {
		subj = 'Website Submitted Email';					// if undefined set default subject
		}
	if ((linktext == undefined) || (linktext == null)) {
		linktext = pre + '@' + dom;						// if undefined default linktext is email address
		}	
	emlink += '?' + 'subject=' + subj + '">';
	emlink += linktext;
	emlink += '<' + '/' + 'a' + '>';
	document.write(emlink);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
MM_preloadImages('../assets/webgfx/nav/bg_nav_over.gif','../assets/webgfx/nav/bg_nav_on.gif');

// Open Links in a New Window
function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") &&
      anchor.getAttribute("rel") == "external")
      anchor.target = "_blank";
    }
}
// window.onload = externalLinks;
