/***********************************************************************
*
*	WScms_style.css - JavaScript Module for the WScms core
*							
*							Version: 2.0
*
*					Last updated: 29/11/2006 10:00 PM
*
************************************************************************/

<!--
function nwLink(url)
{
	window.open(url, '_blank');
	if (window.event) event.returnValue = false;
	return false;
}
// -->
<!--
function cwLink(url)
<!--
{
	window.open(url, '_top');
}
// -->
<!--
function bookmark(url,pagename)
{
	var bookmarktitle = pagename;
	var bookmarkurl = url;
	netscape="First click OK and then hit CTRL+D to bookmark this page.";

	if (navigator.appName=='Microsoft Internet Explorer')
	{
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}
	else if (navigator.appName=='Netscape')
	{
		alert(netscape);
	}
}
// -->
<!--
function openWindow(pageID,w,h)
{
	w=w+45;
	h=h+58;
	newWindow = window.open('' + pageID + '','_blank','width=' + w + ',height=' + h + ',location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'); 
	newWindow.focus();
	if (window.event) event.returnValue = false;
	return false;
}
// -->
<!--
function openLockedWindow(pageID,w,h)
{
	w=w+45;
	h=h+58;
	newWindow = window.open('' + pageID + '','_blank','width=' + w + ',height=' + h + ',location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no'); 
	newWindow.focus();
	if (window.event) event.returnValue = false;
	return false;
}
// -->
<!--
function confirmUserDelete(Username)
{
	var confirmDelete;
	confirmDelete=window.confirm("Are you sure you want to delete the user '" + Username + "'?");
	if(confirmDelete){return true;}else{return false;}
}
// -->
<!--
function deleteFile(ElementID,Filename)
{
	var confirmDelete;
	confirmDelete=window.confirm('Are you sure you want to delete the file ' + Filename);
	if(confirmDelete)
	{
		document.getElementById(ElementID).submit()
		return true;
	}
}
// -->
<!--
function toggleDivVis(divID)
{
	if(document.getElementById(divID).style.display == 'none')
	{
		document.getElementById(divID).style.display = 'block'; 
	}
	else if(document.getElementById(divID).style.display == 'block')
	{
		document.getElementById(divID).style.display = 'none';
	}
}
// -->
<!--
function textLinkHover(hovering,hoverText)
{
	if(hovering==1)
	{		
		window.status=hoverText;
	}
	else if(hovering==0)
	{
		window.status='';
	}
	return true;
}
// -->
<!--
function checkFileUpload()
{
	if(document.getElementById('file').value=='')
	{
		window.alert('Please specify a file to be uploaded.');	
		return false;
	}
	else
	{
		return true;
	}
}
// -->
<!--
function contactFormValidate()
{
	var passedValidation = true;
	var errorMessage = "The following error(s) occurred:\n\n";
	var emailRegEx = /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,4})$/;
	var phoneRegEx=/^[-+0-9()\s]+$/;
	var txtName = document.getElementById('txtName').value;
	var txtPhone = document.getElementById('txtPhone').value;
	var txtEmail = document.getElementById('txtEmail').value;
	var contactmethodPhone = document.getElementById('contactmethod-phone').checked;
	var contactmethodEmail = document.getElementById('contactmethod-email').checked;
	var txtMessage = document.getElementById('txtMessage').value;
	var txtUsrVerification = document.getElementById('txtUsrVerification').value;
	
	if( (txtName.length==0) || (txtName==null) )
	{
		errorMessage+="-Please enter your name.\n";
		passedValidation = false;
	}
	
	if( (txtPhone.length==0) || (txtPhone==null) )
	{
		errorMessage+="-Please enter your phone or mobile number.\n";
		passedValidation = false;
	}
	else if(phoneRegEx.test(txtPhone)==false)
	{
		errorMessage+="-Your phone or mobile number must be numeric.\n";
		passedValidation = false;	
	}
	
	if( (emailRegEx.test(txtEmail)==false) && !((txtEmail.length==0) || (txtEmail==null)) )
	{
		errorMessage+="-A valid email address must be entered.\n";
		passedValidation = false;
	}
	
	if (!((contactmethodPhone) || (contactmethodEmail)))
	{
		errorMessage+="-Please select a preferred contact method.\n";
		passedValidation = false;
	}
	
	if( (txtMessage.length==0) || (txtMessage==null) )
	{
		errorMessage+="-Please enter your message.\n";
		passedValidation = false;
	}
	
	if( (txtUsrVerification.length==0) || (txtUsrVerification==null) )
	{
		errorMessage+="-Please enter the image verification characters.\n";
		passedValidation = false;
	}
	
	if(passedValidation)
	{
		return true;
	}
	else
	{
		window.alert(errorMessage);
		return false;
	}
}
// -->
<!--
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 MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
// -->
<!--
function verifyLoginForm()
   {
      if (document.forms[0].Username.value == ""){
      window.alert("Please enter your Username.");
      document.forms[0].Username.focus();
      return false; 
	}
    else if (document.forms[0].Password.value == ""){
       window.alert("Please enter your Password.");
       return false; 
	}
    else
	return true;
    }
// -->
<!--
function formfocus()
{
	document.forms[0].elements[0].focus();
}
// -->
<!--
function switchKeyboard()
{
	if(document.getElementById('loginKeysABCDEF').style.display=='block')
	{
		document.getElementById('loginKeysABCDEF').style.display='none';
		document.getElementById('loginKeysQWERTY').style.display='block';
		document.getElementById('KeySwitchText').innerHTML='ABCDEF';
	}
	else if(document.getElementById('loginKeysABCDEF').style.display=='none')
	{	
		document.getElementById('loginKeysQWERTY').style.display='none';
		document.getElementById('loginKeysABCDEF').style.display='block';
		document.getElementById('KeySwitchText').innerHTML='QWERTY';
	}
}
// -->
