var LastEvent;
var TimeoutID;

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showHide(varObj)
{
	var obj = MM_findObj(varObj);
	if (obj.style.visibility == "hidden")
	{
		obj.style.visibility 	= "visible"
		obj.style.display		= ""
	}
	else
	{
		obj.style.visibility 	= "hidden"
		obj.style.display		= "none"
	}
}


function DynLyr() 
{
	var i,p,v,obj,args=DynLyr.arguments;
	
	for (i=0; i<(args.length-2); i+=3)
	{
  		if ((obj=MM_findObj(args[i]))!=null) 
		{ 
			v=args[i+2];
			
			if (obj.style) 
			{ 
				obj=obj.style;
				
				if (v=='show')
				{
					obj.display="";
					obj.visibility="visible"; 
				}
				else
				{
					obj.display="none";	
					obj.visibility="hidden"; 
				
				} 
			}
		}
	}
}

function ChkLyr(varDiv)
{
	var obj 	= MM_findObj(varDiv);
	
	if (obj != null) 
	{ 
		if (obj.style.visibility == "visible")
		{
			obj.style.display="none";	
			obj.style.visibility="hidden";

		}
		else
		{
			obj.style.display="";	
			obj.style.visibility="visible"; 
			
		}
	}
}

function showHideTime(objtoshow,objTabtoshow,objtohide,objTabtohide)
{
	//alert('objtoshow ' + objtoshow + ' objtohide' + objtohide);
 	var obj = MM_findObj(objtoshow);
//	alert(obj.style.visibility);
	if (obj.style.visibility == "hidden")
	{
		obj.style.visibility = "visible";
		obj.style.display = "";
	}
	else
	{
		obj.style.visibility = "hidden";
		obj.style.display = "none";
	}
	
	var objHide  = MM_findObj(objtohide);
//	alert(objHide.style.visibility);
	if (objHide.style.visibility == "hidden")
	{
		objHide.style.visibility = "visible";
		objHide.style.display = "";
	}
	else
	{
		objHide.style.visibility = "hidden";
		objHide.style.display = "none";
	}
	
	
	var objTab1 = MM_findObj(objTabtoshow)
	var objTab2 = MM_findObj(objTabtohide)
	
	//alert('objTab1 ' + objTab1.className + ' objTab2 ' + objTab2.className );
		
	if (objTab1.className=='AfrikaansOn')
	{
		objTab1.className='AfrikaansOff';
		objTab2.className='EnglishOn';		
	}
	else
	{
		objTab1.className='AfrikaansOn';
		objTab2.className='EnglishOff';		
	}

}

function doshowHideTab(objtoshow,objtohide)
{

 	var obj = MM_findObj(objtoshow);
	obj.style.visibility = "visible";
	obj.style.display = "";
	
	var objHide  = MM_findObj(objtohide);
	objHide.style.visibility = "hidden";
	objHide.style.display = "none";

}

function changeClass(objCSS,classCSS)
{
 	var objCSS = MM_findObj(objCSS);
	objCSS.className =classCSS;
}

function Do_OutDelay()
{
	var varFunc;
		
	varFunc = "MM_Out_showHideLayers(";
	
	for(i=0;i<Do_OutDelay.arguments.length;++i)
	{
		if(i > 0)
			varFunc += ",";
			
		varFunc += "'"+ Do_OutDelay.arguments[i] +"'";
	}
	
	varFunc += ")";
	
	LastEvent = "mouseout";
	
	TimeoutID = setTimeout(varFunc,500);
}

function Do_OverDelay()
{
	if(LastEvent == "mouseout" && TimeoutID != ""){
		window.clearTimeout(TimeoutID)
		
		TimeoutID = "";
	}
	
	LastEvent = "mouseover";
	
	var varFunc;
	
	varFunc = "MM_showHideLayers(";
	
	for(i=0;i<Do_OverDelay.arguments.length;++i)
	{
		if(i > 0)
			varFunc += ",";
			
		varFunc += "'"+ Do_OverDelay.arguments[i] +"'";
	}
	
	varFunc += ")";
	
	
	
	setTimeout(varFunc,1);
	
}


function MM_showHideLayers() 
{ 
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	
	for (i=0; i<(args.length-2); i+=3)
	{ 
		if ((obj=MM_findObj(args[i]))!=null) 
		{ 
			v=args[i+2];

			if (obj.style) 
			{ 
				obj=obj.style; 
				
				v=(v=='show')?'visible':(v='hide')?'hidden':v; 
			}

			obj.visibility=v; 
		}
	}	
}

function MM_Out_showHideLayers() 
{
	var i,p,v,obj,args=MM_Out_showHideLayers.arguments;
	
	for (i=0; i<(args.length-2); i+=3)
	{
	 	if ((obj=MM_findObj(args[i]))!=null) 
		{
			v=args[i+2];

			if (obj.style) 
			{ 
				obj=obj.style; 
				
				v=(v=='show')?'visible':(v='hide')?'hidden':v; 
			}
			
			obj.visibility=v; 
		}
	}
}


function open_img(s_showcase,s_location,s_Desc)
{
	window.open('popup.asp?showcase=' + s_showcase+'&filelocation=' + escape(s_location)+'&Desc='+escape(s_Desc),'','scrollbars=yes,resizable=yes,width=640,height=450');
}	
	
function open_content_img(s_showcase)
{
	window.open('popup.asp?showcase=' + s_showcase+'&filelocation=' + escape('')+'&Desc=','','scrollbars=yes,resizable=yes,width=640,height=450');	
}

function doValidateComments(obj)
{
	if (obj.CommentName.value == "")
	{	
		window.alert("Your Name is required !");
		obj.CommentName.focus();
		return false;
	}
	
	if (obj.CommentEmail.value.indexOf('@')==-1 || obj.CommentEmail.value.indexOf('.')==-1)
	{	
		window.alert("A valid Email Address is required !");
		obj.CommentEmail.focus();
		return false;
	}
	
	if (obj.Comment.value == "")
	{	
		window.alert("Your Comments are a required !");
		obj.Comment.focus();
		return false;
	}	
	
	return true;
}

function doValidateContact(obj)
{
	if (obj.FirstName.value == "")
	{	
		window.alert("Your First Name is required !");
		obj.FirstName.focus();
		return false;
	}
	
	if (obj.LastName.value == "")
	{	
		window.alert("Your Last Name is required !");
		obj.LastName.focus();
		return false;
	}	

	if (obj.Email.value.indexOf('@')==-1 || obj.Email.value.indexOf('.')==-1)
	{	
		window.alert("A valid Email Address is required !");
		obj.Email.focus();
		return false;
	}
	
	if (obj.Comment.value == "")
	{	
		window.alert("Your Comments are a required !");
		obj.Comment.focus();
		return false;
	}		
	
}

