function leftmenuyellowlite(linkid)
{
	linkid.className = 'leftmenuyellowlit';
}

function leftmenupinklite(linkid)
{
	linkid.className = 'leftmenupinklit';
}


function imgOver(img)
{
	img.src = 'images/' + img.name + '_over.gif'; img.style.cursor = 'hand'; img.style.cursor = 'pointer';
}	
function imgOut(img)
{
	img.src = 'images/' + img.name + '.gif'; img.style.cursor = 'default'; img.style.cursor = 'default';
}
function imgOverRel(img)
{
	img.src = '../images/' + img.name + '_over.gif'; img.style.cursor = 'hand'; img.style.cursor = 'pointer';
}	
function imgOutRel(img)
{
	img.src = '../images/' + img.name + '.gif'; img.style.cursor = 'default'; img.style.cursor = 'default';
}

function goTo(win)
{
	window.location = win;
}

function winopen(win,size)
{
	window.open(win,'window','top=10,left=10,'+ size +',scrollbars=no');
}

function nonRiskIncome_winopen(win,size)
{
	window.open(win,'window','top=100,left=100,'+ size +',scrollbars=no, status=no');
}

function PDF_winopen(win,size)
{
	window.open(win,'window','top=100,left=100,'+ size +',scrollbars=no, menubar=yes');
}

function addError(ErrorString, NewError) {
			var tmp = ''
	
			if(ErrorString.length==0)
			{
				ErrorString = 'The following fields need to be completed: '
			}
			tmp = ErrorString + '\n' + '  ** ' + NewError
			
			return tmp
		}
		
function validate(frm)
{
	var tmpErr = ''
	with (document.forms[0])
	{
		

			if(frm['mail_from'].value.length == 0)
			{
				tmpErr = addError(tmpErr, "You must enter an email address")
			}	
			if(frm['mail_from'].value.length !== 0)
			{
				
				if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm['mail_from'].value)==false){
					tmpErr = addError(tmpErr, "You must provide a valid email address")
				}
			}
			
			if(frm['name'].value.length == 0)
			{
				tmpErr = addError(tmpErr, "You must enter your name")
			}	
			
			if((frm['dayphone'].value.length == 0) && (frm['eveningphone'].value.length == 0) && (frm['mobilephone'].value.length == 0))
			{
				tmpErr = addError(tmpErr, "You must enter a contact number")
			}	
			
			

	}

	if(tmpErr != '')
	{
		alert(tmpErr)
		return false
	}else{
		return true
	}
}
function show(div)
{
	//alert(div);
	div.style.display = 'inline';
	var otherdiv;
	
	for (var i=1; i<50; i++)
	{
		if (document.getElementById)
			otherdiv=document.getElementById("div" + i);
		else
			otherdiv=document.all("div"+i);
		
		if (otherdiv)
		{
			if (otherdiv!=div)
			{
				otherdiv.aselected="false";
				hide(otherdiv);
			}
		}
	}
	
}

function hide(div)
{    
	div.style.display = 'none';
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
<!-- // DDMenu //-->

  var eOpenMenu = null;
  function OpenMenu(eSrc,eMenu){
    eMenu.style.left = eSrc.parentElement.offsetLeft + divMenuBar.offsetLeft;
    eMenu.style.top = divMenuBar.offsetHeight + divMenuBar.offsetTop;
    eMenu.style.visibility = "visible";
    eOpenMenu = eMenu;
  }

  function CloseMenu(eMenu){
    eMenu.style.visibility = "hidden";
    eOpenMenu = null;
  }

  function MenuBar_over(){
    var eSrc = window.event.srcElement;
    if ("A" == eSrc.tagName.toUpperCase()){
      var eMenu = document.all[eSrc.parentElement.id.replace("tdMenuBarItem","divMenu")];
      if (eOpenMenu && eOpenMenu != eMenu){
        CloseMenu(eOpenMenu);}
      if (eMenu){
		  OpenMenu(eSrc,eMenu);}
    }
  }

  function MenuBar_out(){
    var eTo = window.event.toElement;
    if (eOpenMenu && eTo && !eOpenMenu.contains(eTo) && "tblMenuBar" != eTo.id){
      CloseMenu(eOpenMenu)}
	}

  function Menu_out(){
    var eSrc = window.event.toElement;
    if (eOpenMenu && !eOpenMenu.contains(eSrc) && !divMenuBar.contains(eSrc)){
      CloseMenu(eOpenMenu)}
	}

