//==== Check and create flash object
function MM_CheckPlugin(plgIn, theFlash, theJPG, autoGo, pWidth, pHeight) { 
	var ok=false; document.MM_returnValue = false;
	with (navigator) if (appName.indexOf('Microsoft')==-1) ok=(plugins && plugins[plgIn]);
	else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
	if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
	else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
	else ok=false; }
	if (!ok)
	{
		document.write("<img src='" + theJPG + "' width=" + pWidth + " height=" + pHeight + ">");
	} else 
	{
		document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0' width=" + pWidth + " height=" + pHeight + "><param name=movie value='"+ theFlash + "'><param name=quality value=high>");
		document.write("<embed src='" + theFlash + "' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=" + pWidth + " height=" + pHeight + "></embed></object>");
	}
}

//==== change image on mouse over event
function mOver(imageName){
	 if (document.images) {
	document[imageName].src =eval(imageName + "Over.src");
	}
}

//==== change image on mouse out event
function mOut(imageName) {
	 if (document.images) {
	document[imageName].src =eval(imageName + "Out.src");
	}
}

//==== change other image on mouse over event
function bsOver(imageName){
	 if (document.images) {
	document.bs.src =eval(imageName + "Over.src");
	}
}

//==== change image on mouse out event
function bsOut(imageName) {
	 if (document.images) {
	document.bs.src =eval(imageName + "Out.src");
	}
}

//==== chane URL
function Redirect(destURL)
{
	top.location.href=destURL;
}

//==== change URL with delay
function RedirectWithDelay(destURL)
{
	window.setTimeout("Redirect('"+destURL+"');", 5000);
}

//==== animate title bar initilize
function AniTitleBar() {
	var bText=document.title
	var bLength=bText.length+10
	TypeTitleBar(0, bText, bLength)
}

//==== type new title bar
function TypeTitleBar(it, bText, bLength)
{	if (it<=bLength)
	{	document.title=bText.substring(it,bLength)
		it++
		setTimeout("TypeTitleBar('"+it+"', '"+bText+"', "+bLength+")",500)
	}
	else
	{	it=0
		TypeTitleBar(0, bText, bLength)
//		return
	}
}

function ValidateField(theForm)
{	if ( (theForm.txtName.value == "") || (theForm.txtEmail.value == "") || (theForm.txtComment.value == "") )
	{	alert("Please complete required fields before continue");
		return (false);
	}
}

/**
 * Toggle DIV visibility.
 */
function toggleDiv(divid){
    if(document.getElementById(divid).style.display == 'none'){
      document.getElementById(divid).style.display = 'block';
    }else{
      document.getElementById(divid).style.display = 'none';
    }
  }
