// JavaScript Document
function safemail(name, domain, display) {
	displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
	document.write(displayed);
	}
function selectText(theField) {
	var tmpval = theField;
	document.getElementById(tmpval).value = '';
	}
function refill(TextBox) {
	var targetElement = document.getElementById(TextBox);
	if (targetElement.value == "") {
		targetElement.value = 'E-mail';
		}
	}
function SubmitForm(theForm) {
	document.getElementById(theForm).submit();
	}
function change_height() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
	e=document.getElementById("mainContent");
	e.style.minHeight = (myHeight - 75) + 'px';
	//scroll(0,0);
	}
function checkWindowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

	e=document.getElementById("mainContent");
	e.style.minHeight = (myHeight - 75) + 'px';

	if ((e.style.height<=645) && (myHeight<=645)) {
		e.style.minHeight = 645 + 'px';
		}

	//document.getElementById("mainContent").value(endPoint);

	if ((myWidth<=960) || (myHeight<=682)) {
		document.getElementById('wip_text').style.position = 'absolute';
		}
	else {
		document.getElementById('wip_text').style.position = 'fixed';
		}
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}
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";
 }
}
function change_height_old() {
	e=document.getElementById("mainContent");
	e.style.height = (screen.height - 150) + 'px';
	scroll(0,0);
	}

window.onload = function () {
  checkWindowSize();
}
