var xmlHttp

function categoryPlay(id) { 
	document.getElementById('work_pagecontent').innerHTML="loading ...";
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
		alert ("Browser does not support AJAX")
		return
	}
	var url="/videoPlay.cfm?category=" + id + "&sid=" + Math.random();
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	if (window.XMLHttpRequest) {
		xmlHttp.send(null);
	} else if (window.ActiveXObject) {
		if(xmlHttp)	{
			xmlHttp.send()
		}
	}
	function stateChanged() { 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById('work_pagecontent').innerHTML=xmlHttp.responseText 
		} 
	} 
}

function videoPlay(id,category) { 
	document.getElementById('work_pagecontent').innerHTML="loading ...";
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
		alert ("Browser does not support AJAX")
		return
	}
	var url="/videoPlay.cfm?videotoplay=" + id + "&category=" + category + "&sid=" + Math.random();
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	if (window.XMLHttpRequest) {
		xmlHttp.send(null);
	} else if (window.ActiveXObject) {
		if(xmlHttp)	{
			xmlHttp.send()
		}
	}
	function stateChanged() { 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
			document.getElementById('work_pagecontent').innerHTML=xmlHttp.responseText 
		} 
	} 
}

function GetXmlHttpObject() { 
	var objXMLHttp=null
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}


function validate_email(field,alerttxt) {
	with (field) { 
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {alert(alerttxt);return false;}
		else { return true; }
	}
}
function validate_form(thisform,fieldtovalidate)
{
	with (thisform)
	{
	if (validate_email(fieldtovalidate,"Not a valid e-mail address!")==false)
	  { return false;}
	}
}