/************* HOMEPAGE IMAGE FUNCTION ***********************/


// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = '/aml/images/home_1.jpg'
theImages[1] = '/aml/images/home_2.jpg'
theImages[2] = '/aml/images/home_3.jpg'
theImages[3] = '/aml/images/home_4.jpg'
theImages[4] = '/aml/images/home_5.jpg'
theImages[5] = '/aml/images/home_6.jpg'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}




/************* STANDARD POPPER FUNCTION ***********************/

function popJS(){
	var _args=arguments,_tag=_args[0],_class=_args[1];
	if(document.getElementById){
		var _a=[],_i=0;
		_a=document.getElementsByTagName(_tag);
		for(_i;_i<_a.length;_i++){
			if(_a[_i].className && (_a[_i].className==_args[1])){
				_a[_i].onclick=function(){javascript:w(this.href,_args[1]);return false;};
				_a[_i].onkeypress=function(){javascript:w(this.href,_args[1]);return false;};
			}
		}
	}
}


var win;



function getWindowCenter(_iX,_iY){
 var iWinX=(screen.width - _iX)/2;
 var iWinY=(screen.height - _iY)/2;
 return('top='+iWinY+',left='+iWinX);
}



function createWindowName(_sUrl){

 var _iLastSlash=_sUrl.lastIndexOf('/');

 var _iLastSlashMin=_sUrl.substring(0,(_iLastSlash-1)).lastIndexOf('/');

 return(_sUrl.substr(_iLastSlash,_sUrl.length).indexOf('.')>0)?('file_'+escape(_sUrl.substring(_iLastSlash+1,_sUrl.lastIndexOf('.')))):('file_'+ escape(_sUrl.substring((_iLastSlashMin+1),_iLastSlash)));

}



function createWindow(_sUrl,_sName,_sParams){

 win=window.open(_sUrl,_sName,_sParams);

 if(win){win.focus();}
 return(win);

}

function w(_sUrl,_sType){
 var _sParams,_sName,_sWinPos,_iX,_iY;
 switch(_sType){
  case'html':
   _iX=800;
   _iY=600;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=1,status=1';
   _sName='form';
   break;
  case'image': 
   _iX=450;
   _iY=300;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1';
   _sName='video';
   break;
  case'slideshow': 
   _iX=750;
   _iY=410;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1';
   _sName='slideshow';
   break;
  case'webcast':
   _iX=750;
   _iY=550;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1';
   _sName='wceken';
   break;
  case'form':
   _iX=645;
   _iY=440;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1';
   _sName='form';
   break;
  case'text':
  case'note':
   _iX=640;
   _iY=500;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1'; 
   _sName=createWindowName(_sUrl);
   break;
  case'relatedlinks':
   _iX=600;
   _iY=200;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,resizable=0,status=1'; 
   _sName='relatedlinks';
   break;
  case'print':
   _iX=640;
   _iY=550;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0;toolbars=0,menubar=1,resizable=0,status=1'; 
   _sName='print';
   break;
  case'table':
  case'large':
   _iX=924;
   _iY=600;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0,toolbars=1,resizable=1,status=1';
   _sName=createWindowName(_sUrl);
   break;
  case'word':
  case'xls':
  case'pdf':
   _iX=600;
   _iY=500;
   _sParams='height='+_iY+',width='+_iX+',scrollbars=1,location=0,toolbars=1,menubar=1,resizable=1,status=1';
   _sName='file';
   break;
 };

 _sWinPos=getWindowCenter(_iX,_iY);

 _sParams+=','+_sWinPos;

 return(createWindow(_sUrl,_sName,_sParams));

}



/************* ADJUSTABLE POPPER ***********************/

var newWin = null; 
function popUp(strURL, strType, strHeight, strWidth) { 
 var strOptions=""; 
if (strType=="fixedmenu")strOptions="status,menubar,scrollbars,height="+strHeight+",width="+strWidth; 
 if (strType=="console") 
   strOptions="resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixedscroll") 
   strOptions="status,scrollbars,height="+ 
     strHeight+",width="+strWidth; 
if (strType=="fixedpos") 
   strOptions="status,height,screenX=300,left=300,screenY=300,top=300,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="toolbar,menubar,scrollbars,"+ 
     "resizable,location,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elasticmenu") 
   strOptions="menubar,scrollbars,"+ 
     "resizable,height="+ 
     strHeight+",width="+strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus();
 
}

/* BOOKMARK */
function bookMark(){
 if(window.external){
  window.external.AddFavorite(location.href,document.title);
 }else{
  alert("PC users:\n\tClick 'Ctrl + D' to add this page to your bookmarks.\n\tOpera users: 'Ctrl + T'\n\nMacintosh users: \n\tClick 'Apple + D' to add this page to your bookmarks.\n\tOpera users: 'Apple + T'");
 }
}


<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function disclaimWin(theUrl, winName) 
{
window.open(theUrl,winName,'toolbar=yes,status=yes,width=420,height=265,directories=no,SCROLLbars=yes,resize=no,menubar=yes')
}
//-->


function verify_new (f) {

  strErr = '';
  
  var emailRegEx = /.+@.+\../;  
  var nameRegEx = /\w/;  

  if (f.email) {
    if (!emailRegEx.test(f.email.value)) {
        strErr += "\t* Please provide your email adress\n";
    }
  }

  if (f.name) {
    if ( (f.name.value == '') || (f.name.value.indexOf('Your name') != -1) ) {
      strErr += "\t* Please provide your name\n";
    }
  }

  if (strErr) {
    alert ("Please rectify the following errors before we proceed:\n\n" + strErr);
    return false;
  }

  return true;

}

function todelete_reminder() {

		check = confirm('Are you sure you want to delete your account?');
		if ( check == true) {
			return true;
		} else {
			return false;
		}

}
