var tpos,lspc,InfomInterval, intervalID, leftofpositionvar, FindPositionValue, layerwidth, tposVIEWS, lspcVIEWS;

var NS4=(document.layers);

var NS6=(document.getElementById && !document.all);

var IE4plus=(document.all);

    var agt=navigator.userAgent.toLowerCase();



    // *** BROWSER VERSION ***

    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.

    var is_major = parseInt(navigator.appVersion);

    var is_minor = parseFloat(navigator.appVersion);



    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.

    // If you want to allow spoofing, take out the tests for opera and webtv.

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)

                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)

                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));

    var is_nav2 = (is_nav && (is_major == 2));

    var is_nav3 = (is_nav && (is_major == 3));

    var is_nav4 = (is_nav && (is_major == 4));

    var is_nav4up = (is_nav && (is_major >= 4));

    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||

                          (agt.indexOf("; nav") != -1)) );

    var is_nav6 = (is_nav && (is_major == 5));

    var is_nav6up = (is_nav && (is_major >= 5));





    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

    var is_ie3    = (is_ie && (is_major < 4));

    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );

    var is_ie4up  = (is_ie && (is_major >= 4));

    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );

    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));

    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);

    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);

    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );

    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

var sx=screen.width;

if (sx<1000) {BGDURL='linkimages/bgdbigfleaf777.jpg'};

if ((sx>1000)&&(sx<1200)) {BGDURL='linkimages/bgdbigfleaf1024.jpg'};

if (sx>1200) {BGDURL='linkimages/bgdbigfleaf2000.jpg'};



function OpenPopup(linkdoc,target,hite,widt,left,top,scalex,scaley,closepar,scrollon,centre){

var winWidth, winHeight;

if (scaley=='yes') {hite=Math.round(hite/1.28)};

if (scalex=='yes') {widt=Math.round(widt/1.28)};

if (closepar=='yes') {window.close()};

winWidth=screen.width;winHeight=screen.height;

if (centre=='yes') {left=((winWidth)/2)-(widt/2);top=((winHeight)/2)-(hite/2);};

if (winHeight <(hite+top)) {hite=winHeight-40};

if (winWidth < (widt+left)) {widt=winWidth-40};

window.open(linkdoc,target,'height='+hite+',width='+widt+',left='+left+',top='+top+',screenX='+left+',screenY='+top+',scrollbars='+scrollon+',menubar=no,status=no,toolbar=no,resizable=yes');

}



function StopScrollPANCONTAINER() {clearInterval(intervalID)}

function StartScrollPANCONTAINER(dir) {intervalID=setInterval('ScrollJumpPANCONTAINER('+dir+')',10)}



function FindPosition() {

	if (IE4plus) {leftofposition = parseInt(document.all.PANCONTAINER.style.left)} //IE4+

	else if (NS4) {leftofposition = parseInt(document.OUTER.document.PANCONTAINER.left)} //NS4

	else if (NS6) { leftofposition = parseInt(document.getElementById("PANCONTAINER").style.left) }; //NS6

	if (isNaN(leftofposition)) {leftofposition = 0}; //IE4+ for the special condition

	return(leftofposition);

}



function ScrollJumpPANCONTAINER(gowhichway) { 

	if (NS6) {gowhichway=gowhichway*3}; //the factor + 1 must divide into midpoint exactly

	var Midpoint = 2077-777;//pann image width less window of view

	var gow=Math.abs(gowhichway);	

	var AdjustMidpoint = Math.round(gow*    ((Midpoint/gow)-Math.floor(Midpoint/gow))    );

	Midpoint=Midpoint-AdjustMidpoint;	

	FindPositionValue = FindPosition();

	if (FindPositionValue == -1*(Midpoint)) {FindPositionValue = 0} 

	else if ((FindPositionValue == gow)) {FindPositionValue = -1*Midpoint};

	if (IE4plus) { document.all.PANCONTAINER.style.pixelLeft = FindPositionValue + gowhichway}  //IE all

	else if (NS4) {document.OUTER.document.PANCONTAINER.moveTo(FindPositionValue + gowhichway,33)}  //NN4

	else if (NS6) {document.getElementById("PANCONTAINER").style.left = FindPositionValue + gowhichway }; //NN6

}



function StopScrollInfom() {clearInterval(InfomInterval);}

function StartScrollInfom(dir) {InfomInterval=setInterval('ScrollJumpInfom('+dir+')',50);

}

function FindPositionInfom() {

	var positionfromtop;

	if (IE4plus) {positionfromtop = parseInt(document.all.Infom.style.pixelTop)} //IE4+

	else if (NS4) {positionfromtop = parseInt(document.container.document.Infom.top)} //NS4

	else if (NS6) { positionfromtop = parseInt(document.getElementById("Infom").style.top) }; //NS6

	if (isNaN(positionfromtop)) {positionfromtop = 0}; //IE4+ for the special condition

	return(positionfromtop);

}



function ScrollJumpInfom(gowhichway) { 

	var FindPositionValue = FindPositionInfom();

	if (FindPositionValue == (-613)) {FindPositionValue = 0} ;

	if (IE4plus) { document.all.Infom.style.pixelTop = FindPositionValue + gowhichway}  //IE all

	else if (NS4) {document.container.document.Infom.moveTo(0,FindPositionValue + gowhichway)}  //NN4x

	else if (NS6) {document.getElementById("Infom").style.top = FindPositionValue + gowhichway}; //NN6

}



function RELoadNOTNN() {if (IE4plus) {location.reload()}else if (NS6) {window.history.go(0)}}

function RELoadNNifOtherOnResizeEvents() { if(document.layers) {MM_reloadPage(false)}}



function SetLayoutParametersVIEWS() {

	if (NS4 || NS6) {winWidVIEWS=parseInt(window.innerWidth);winHgtVIEWS=parseInt(window.innerHeight)}

	else if (IE4plus) {winWidVIEWS=document.body.clientWidth;winHgtVIEWS=document.body.clientHeight}

	if ((winWidVIEWS-777)/2<0) {lspcVIEWS=11} else {lspcVIEWS=(Math.round(winWidVIEWS-777)/2)};

	if((((winHgtVIEWS-435)/2)-50)<0) {tposVIEWS=0} else {tposVIEWS=Math.round((winHgtVIEWS-435)/2)-50};
	
}



function CentreAndShowNOW() {

 if (IE4plus) {document.all.OUTER.style.left=lspcVIEWS;document.all.OUTER.style.top=tposVIEWS;document.all.OUTER.style.visibility='visible'}

 else if (NS4) {document.layers.OUTER.left=lspcVIEWS;document.layers.OUTER.top=tposVIEWS; document.layers.OUTER.visibility='visible'}

 else if (NS6) {document.getElementById("OUTER").style.left=lspcVIEWS;document.getElementById("OUTER").style.top=tposVIEWS;document.getElementById("OUTER").style.visibility='visible'};

}



function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);



function P7_ReDoIt() {if(document.layers) {MM_reloadPage(false);}}



function MM_callJS(jsStr) { //v2.0

  return eval(jsStr)

}



function MM_swapImgRestore() {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_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];}

}



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 P7_Snap() {

  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);

  for (k=0; k<(args.length-3); k+=4)

   if ((g=MM_findObj(args[k]))!=null) {

    el=eval(MM_findObj(args[k+1]));

    a=parseInt(args[k+2]);b=parseInt(args[k+3]);

    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";

    if(document.getElementById) {

     d="document.getElementsByName('"+args[k]+"')[0]";

     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}

    }else if(document.all) {d=da;} 

    if (document.all || document.getElementById) {

     while (tx==1) {p+=".offsetParent";

      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));

      }else{tx=0;}}

     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;

     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {

      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);

      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;

      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;

      x=document.body.scrollLeft + event.clientX + bx;

      y=document.body.scrollTop + event.clientY;}}

   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";

    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;

     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}

   if(el) {e=(document.layers)?el:el.style;

   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);

   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}

   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){

    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);

    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}

}



function LoadHome(urlname) {

if (!window.opener){if (top == self) self.location.href = "index.htm";}

close();

homeload.href = urlname;

}



function KillError() {

//turns of any error report from faulty javascript

self.onerror =function() {return true; }

}