function validateEmail(str){     //returns true if str is valid e-mail, false if not
if(!/^[\w-\.]+@[\w-]+\.([\w-]+\.)?[a-z]{2,6}$/i.test(str)) return false;
else return true;
}

function validateField(str) {    //returns true if str not empty, false if str empty
return (!(str==""));
}

function trim(str){   //returns passed string with leading and trailing spaces removed
var trStr = str.replace(/^\s+/,"").replace(/\s+$/,"");
return trStr;
}

function swapImg(){
var i;
if (document.getElementById){
	for(i=0;i<arguments.length;i+=2) document.getElementById(arguments[i]).src = arguments[i+1];
	return true;
	}
else if (document.images) {
	for(i=0;i<arguments.length;i+=2) document.images[arguments[i]].src = arguments[i+1];
	return true;		
	}
else return false;
}

function jump(el){
var url = el.options[el.selectedIndex].value;
if ((url=="")||(url=="#")) return false;
window.location = url;
return true;
}

function goPage() {
window.location.href = document.form_1.select_1.options[document.form_1.select_1.selectedIndex].value;
}

function popInfo(url,w,h) {
var info = window.open(url,'info','width='+w+',height='+h+',toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1');
info.focus();
}

function openDARC(){
var mtrc_pop = window.open("/Spanish/refreshercourse.htm","mtrc_pop","width=300,height=238,top=75,left=240,menubar=no,location=no,scrollbars=no,status=no,resizable=no");
}

function calWin(page){
var Mtsoft = window.open(page, "Mtsoft", "toolbar=no,width=700,height=516,menubar=no,location=no,scrollbars=no,resize=no,status=no");
}

function launchMTD(page){
var winw = screen.width<=800?screen.width-40:880;
var winh = screen.height<=600?screen.height-60:640;
mtdWin = window.open(page,"","width="+winw+",height="+winh+",toolbar=0,location=0,status=0,menubar=0,directories=0,scrollbars=1,resizable=1");
}

function calRTTutorial(page){
	var RTtut = window.open(page, "RTtut",
							"toolbar=no,width=840,height=637,menubar=no, location=no, scrollbars=no, resize=no, status=no");
}

function calRTTutorial2(page){
	var RTtut = window.open(page, "RTtut",
							"toolbar=no,width=870,height=685,menubar=no, location=no, scrollbars=no, resize=no, status=no");
}

function startLS(){
	window.open('http://www.mastertrader.com/live_support.asp','','width=400,height=375,status=0,location=0,resizable=0,menubar=0,toolbar=0');
}

