function forgetPassword() {
	var fm = document.login_form;
	if (fm.username.value == '') {
		alert('Please enter your username or email in the username box first.');
	} else {
		fm.action = 'forget_password.php';
		fm.submit();
	}
}

function popUpDemo() {
	popWin = window.open('http://www.crocolearn.com/flash/demo.htm', '', 'width=1020,height=630,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes');
	//popWin.moveTo(50,100);
	popWin.focus();
}

function popUpDemo2() {
	popWin = window.open('demo_flashcard.htm', '', 'width=810,height=610,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes');
	popWin.focus();
}

function popUpDemo3() {
	popWin = window.open('http://www.crocolearn.com/flash/demo2/demo2.htm', '', 'width=1020,height=619,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes');
	popWin.focus();
}

function popUp(url, w, h) {
	popWin = window.open(url, '', 'width='+w+',height='+h+',toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes');
	popWin.focus();
}

function showhide(element, act) {
	if (act == 'hide') {
		act = 'none';
	} else {
		act = 'block';
	}
	if (document.all) {
		document.all[element].style.display = act;
	} else {
		document.getElementById(element).style.display = act;
	}
}

function showHideLayer(layer, action) {
	var vis = document.all[layer].style;
	(action == "Y") ? vis.visibility = "visible" : vis.visibility = "hidden";
}

function chgBgColor(e, col) {
	e.style.backgroundColor = '#' + col;
}

function parSet(form, par, value) {
	if (navigator.appName == "Microsoft Internet Explorer") {
		if(!eval(form+'.'+par))
			return;
	} else if (navigator.appName == "Netscape") {
		if(eval(form+'.'+par)==undefined)
			return;
	}

	var type = '';
	type = eval(form+'.'+par+'.type');
	
	if (navigator.appName == "Microsoft Internet Explorer") {
		if ( (eval(form+'.'+par+'.length') > 1) && (type != "select-one") && (type != "select-multiple") )
			type = eval(form+'.'+par+'[0].type');
	} else if (navigator.appName == "Netscape") {
		if ( (type == undefined) || ( (eval(form+'.'+par+'.length') > 1) && (type.length==0) ) )
			type = eval(form+'.'+par+'[0].type');
	} else alert("Your browser may have problem to run this page.")
	
	if (type == 'checkbox') {
		if ( (value != null) && (value == eval(form+'.'+par+'.value')) )
		eval(form+'.'+par+'.checked = true;');
	} else if (type == 'radio') {
		loop_count = 0;
		for (i=0; i < eval(form+'.'+par+'.length'); i++) {
			loop_count++;
			if (eval(form+'.'+par+'['+i+'].value == \''+ value + '\''))
				eval(form+'.'+par+'['+i+'].checked = true'); 
		}
		if (loop_count == 0) {
			if (eval(form+'.'+par+'.value == \''+ value + '\''))
				eval(form+'.'+par+'.checked = true'); 
		}
	} else if (type.indexOf('select') != -1) {
		for (i=0; i < eval(form+'.'+par+'.options.length'); i++) {
			//alert(form+'.'+par+'.options['+i+'].value == \'' + value + '\'');
			if (eval(form+'.'+par+'.options['+i+'].value == \'' + value + '\''))
				eval(form+'.'+par+'.options['+i+'].selected = true');
		}
	} else if (type != 'file') {
		eval(form+'.'+par+'.value = \'' + value + '\'');
	}
}

// Sound on Mouseover javascript supplied by http://www.hypergurl.com
/*
var aySound = new Array();
// PLACE YOUR SOUND FILES BELOW
aySound[0] = "../sound/i_can_read_it.wav";
aySound[1] = "../sound/i_can_spell.wav";
aySound[2] = "../sound/i_can_talk.wav";
aySound[3] = "../sound/lets_play.wav";
aySound[4] = "../sound/with_crocopen.wav";

// Don't alter anything below this line
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

//if (!IE) alert('Please use Microsoft Internet Explorer version 5.0 or higher to browse this website.');

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.soundfiles:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); } */