
function popUp(URL,scr,wi,he) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars="+scr+",location=0,statusbar=0,menubar=0,width="+wi+",height="+he+",left = 100,top = 100');");
}
function openPopUp(url, newwindow, w_width, w_height){
	xpos	= (screen.width - w_width)/5;
	ypos	= (screen.height - w_height)/5;
	window.open(url, newwindow, "width="+w_width+", height="+w_height+", left="+xpos+", top="+ypos);
}

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

function check(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){
			return (false);
		}
	}
	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) {
			return (-1);
		}
	}
}
function checkPrint_app(print_app){
	
		if(print_app.email.value < 1 || print_app.email.value == 'Email'){
		print_app.email.focus();
		alert("Please enter a valid Email address.");
		if(document.all || document.getElementById){
			print_app.email.style.background = "#DBE7F5";
		}
		return (false);
	}
}

function checkF(f){
	
	if(f.name.value < 1 || f.name.value == 'Name'){
		f.name.focus();
		//alert("Please enter your first name.");
		if(document.all || document.getElementById){
			f.name.style.border = "2px solid #000000";
			f.name.style.background = "#f2f3f5";
			f.title.style.background = "#FFFFFF";
			f.company.style.background = "#FFFFFF";
			f.address.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	if(f.title.value < 1 || f.title.value == 'Title'){
		f.title.focus();
		//alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.border = "2px solid #000000";
			f.title.style.background = "#f2f3f5";
			f.company.style.background = "#FFFFFF";
			f.address.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	if(f.company.value < 1 || f.company.value == 'Company'){
		f.company.focus();
		//alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.background = "#FFFFFF";
			f.company.style.border = "2px solid #000000";
			f.company.style.background = "#f2f3f5";
			f.address.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	
	if(f.address.value < 1 || f.address.value == 'Address'){
		f.address.focus();
		//alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.background = "#FFFFFF";
			f.company.style.background = "#FFFFFF";;
			f.address.style.border = "2px solid #000000";
			f.address.style.background = "#f2f3f5";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	if(f.city.value < 1 || f.city.value == 'City'){
		f.city.focus();
		//alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.background = "#FFFFFF";
			f.company.style.background = "#FFFFFF";;
			f.address.style.background = "#FFFFFF";
			f.city.style.border = "2px solid #000000";
			f.city.style.background = "#f2f3f5";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	if(f.state.value < 1 || f.state.value == 'State'){
		f.state.focus();
		//alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.background = "#FFFFFF";
			f.company.style.background = "#FFFFFF";;
			f.address.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.border = "2px solid #000000";
			f.state.style.background = "#f2f3f5";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	if(f.zip.value < 1 || f.zip.value == 'Zip'){
		f.zip.focus();
		//alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.background = "#FFFFFF";
			f.company.style.background = "#FFFFFF";;
			f.address.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.border = "2px solid #000000";
			f.zip.style.background = "#f2f3f5";
			f.phone.style.background = "#FFFFFF";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	if(f.phone.value < 1 || f.phone.value == 'Phone'){
		f.phone.focus();
		//alert("Please enter the name of your institution.");
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.background = "#FFFFFF";
			f.company.style.background = "#FFFFFF";;
			f.address.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.border = "2px solid #000000";
			f.phone.style.background = "#f2f3f5";
			f.email.style.background = "#FFFFFF"
		}
		return (false);
	}
	
	if(!check(f.email.value)){
		alert("Please enter a valid Email address.");
		f.email.focus();
		if(document.all || document.getElementById){
			f.name.style.background = "#FFFFFF";
			f.title.style.background = "#FFFFFF";
			f.company.style.background = "#FFFFFF";;
			f.address.style.background = "#FFFFFF";
			f.city.style.background = "#FFFFFF";
			f.state.style.background = "#FFFFFF";
			f.zip.style.background = "#FFFFFF";
			f.phone.style.background = "#FFFFFF";
			f.email.style.border = "2px solid #000000";
			f.email.style.background = "#f2f3f5"
			
		}
		return (false);
	}
	
}