
/* Creates access keys for all links */

function accesskeys() {
	if (document.getElementsByTagName)
	{
		var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
anchor.accessKey = anchor.innerHTML.substring(0,1);
}
}
}
window.onLoad = accesskeys;


/* Disables automatic Enter or Submit for a form button */

function disp(el) {
	el.children[1].style.display = (el.children[1].style.display==''?'block':'')
}
function checkKey(el) {
	if (event.keyCode==13)
		el.click()
}

/* LOAD MENU AND EXTERNAL LINK JAVASCRIPTS */

			function start() {
				init();
				externalLinks(); }
			window.onload = start;


/* Compares two fields in form to validate e-mail */

//--------------------------------
// This code compares two fields in a form and submit it
// if they're the same, or not if they're different.
//--------------------------------
function checkEmail(theForm) {
    if (theForm.txtEmail.value != theForm.valid_email.value)
    {
        alert('Those e-mail addresses do not match!');
        return false;
    } else {
        return true;
    }
}


/* Fades in text between span=fade tags -- needs onLoad in body tag */

var col=255;
function fade() { document.getElementById("fade").style.color="rgb(" + col + "," + col + "," + col + ")"; col-=5; if(col>0) setTimeout('fade()', 10); }


/* Detects whether page is trapped inside a framed site and breaks it out */

if (top.location !== self.location) {
top.location=self.location;
}


/* Open new windows */

function openNewWindow() {
  popupWin = window.open('http://webdesign.about.com/',
    'open_window',
    'menubar,toolbar,location,directories,status,scrollbars,resizable,dependent,width=700,height=480,left=0,top=0')
}

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


/* Fix for IE for the Mac, which does not "auto-clear" floats and does not support :after, */

function fixmacie(classname){
var divs=document.getElementsByTagName("DIV");
  for(var d=0; d < divs.length;d++){
 if(divs[d].className.indexOf(classname)==0){
 divs[d].innerHTML+= "<div class='mac-clearfix'> <\/div>";
/* The above html tags get added to the end of
the cleared container if the browser is IE/mac. */
 } } }
function init(){
/* Check if the browser is IE5 Mac */
   if( navigator.appVersion.indexOf('Mac')!=-1 && document.all){
/* Pass the class name on the container to fixmacie
(must be the FIRST classname if multiple classnames
are used on the div!) */
 fixmacie("clearfix");
 } }
/* start the ball rolling when the page loads */
window.onLoad=init;


/* Reloads the window if Nav4 resized */

function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
}}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



/* Refresh/reload page to make small em text readable */

function emsTweak()
{
	if ((document.createElement) && (document.createTextNode))
	{
		document.writeln('<div id="emsTest" style="position:absolute; visibility:hidden; font-family:verdana, arial, Helvetica, Geneva, sans-serif">&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br><\/div>');
		var scaling=86;
		if ((navigator.platform=="Win32") && (navigator.appName=="Microsoft Internet Explorer")) scaling=90;
		var h=900;
		if (document.getElementById('emsTest').clientHeight) h=parseInt(document.getElementById('emsTest').clientHeight);
		else if (document.getElementById('emsTest').offsetHeight) h=parseInt(document.getElementById('emsTest').offsetHeight);
		if (h<82) document.body.style.fontSize=Math.round(scaling*90/h)+"%";
	}
}

