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_reloadPage(init) { 
  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); 
loaded=0;

//function Popup(a,msg,look,x,y){ //v1.0.4
//  var d=document; if (!a){var ln="MyPlayer";dx="";dy="";b=(d.layers)?1:0;
//    nn=(b||d.getElementById &&!d.all)?1:0;l = new Object(); loaded=1;
//    l.s=b?d.layers[ln]:MM_findObj(ln).style;l.r=b?d.layers[ln].document:MM_findObj(ln);
//    l.w=function (t) {if(b){l.r.write(t);l.r.close()}else l.r.innerHTML=t}
//    if(b) d.captureEvents(Event.MOUSEMOVE);d.onmousemove=function(e)
//    {dx=(nn)?e.pageX:event.x;dy=(nn)?e.pageY:event.y;}}if (a=="1" && loaded==1) {l.s.visibility="hidden"}
//  if (a=="2" && loaded==1) {l.w("<table border=\"0\" cellspacing=\"5\" cellpadding=\"0\"><tr><td class='"+look+"'>"+unescape(msg)+"</td></tr></table>")
//    if(d.all) dy=dy+d.body.scrollTop;x=(!x)?50:Number(x);
//    y=(!y)?-20:Number(y);l.s.left=dx+x; l.s.top=dy+y;l.s.visibility='visible'}
//}

var obj,timer,stopObj,px,sf=navigator.userAgent.indexOf('Safari')!=-1;
function initObjects() {
  var a=initObjects.arguments,i;obj=new Array();d=(sf || document.all || document.getElementById);
  px=(d)?"px":"";for(i=0;i<a.length;i++){obj[i]=(d && !sf)?MM_findObj(a[i]).style:MM_findObj(a[i]);
	obj[i].hClip=(!d)?obj[i].clip.height:MM_findObj(a[i]).offsetHeight
	obj[i].wClip=(!d)?obj[i].clip.width:MM_findObj(a[i]).offsetWidth	
	obj[i].v=0;obj[i].h=0;
  }
}
function moveObject(v,a,o) {
    if (v=='v' || v=='b') { 
        obj[o].v=((obj[o].v-a)>0)?0:obj[o].v-a;
        obj[o].v=(obj[o].v<-(obj[o].hClip-obj[0].hClip))?-(obj[o].hClip-obj[0].hClip):obj[o].v;
        if (sf) obj[o].style.top= obj[o].v+px; else obj[o].top=obj[o].v+px;
    }
    if (v=='h' || v=='b'){
        obj[o].h=((obj[o].h-a)>0)?0:obj[o].h-a;
        obj[o].h=(obj[o].h<-(obj[o].wClip-obj[0].wClip))?-(obj[o].wClip-obj[0].wClip):obj[o].h;
        if (sf) obj[o].style.left=obj[o].h+px; else obj[o].left=obj[o].h+px;
     }
    if (!stopObj) setTimeout("moveObject('"+v+"',"+a+","+o+")",30)
}
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_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];}
}

// -------------------------------------------------------------
// for the gallery
// -------------------------------------------------------------
function OpenWin() {
  z=MM_findObj('mainPhoto').src.replace("","");
  var dimImg=new Array(
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525,
  395,525
  );
  var w=parseInt(screen.width/2-dimImg[sAPS]/2),h=parseInt(screen.height/2-dimImg[Number(sAPS)+1]/2);
  var look='width='+dimImg[sAPS]+',height='+dimImg[Number(sAPS)+1]+',screenX='+w+',screenY='+h+',left='+w+',top='+h+''
    popwin=window.open('','',look);
    popwin.document.open();
popwin.document.write("<html><head><title>:: Click to Close ::</title><META HTTP-EQUIV=\"imagetoolbar\" CONTENT=\"no\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><style type=\"text/css\"> <!-- BODY {  margin : 10px; } --> </style><body bgcolor=#CCCC99  marginwidth=\"0\" marginheight=\"0\" onBlur=\"window.close()\"><table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td ><a href='javascript:self.close();'><img src='"+z+"' border=0 alt=\"Click Image to Close\"></a></td></tr></table></body></html>");
    popwin.document.close();
}

function hideIt() {
	lObj = (document.layers)?MM_findObj('Cover'):MM_findObj('Cover').style;
	lObj.visibility='hidden'
    clearTimeout(coverTimer); 
}
function hideIt2() {
	lObj = (document.layers)?MM_findObj('ScrollCover'):MM_findObj('ScrollCover').style;
	lObj.visibility='hidden'
}
var sAPS=0;
var coverTimer = null;
function SwitchPhoto(photo,counter) {
	//lObj = (document.layers)?MM_findObj('Cover'):MM_findObj('Cover').style;
	MM_findObj('mainPhoto').src=photo;
    //lObj.visibility="visible";
	//covertimer = setTimeout("hideIt()",5000);
  sAPS=counter;
}

lOldObj=new Object();
function SwitchSection(sVal) {
    var cap="MainCaption"+sVal;
    lObj = (document.layers)?MM_findObj(cap):MM_findObj(cap).style;
    lObj.visibility="visible";
     if (lOldObj!=lObj) lOldObj.visibility = "hidden";
    lOldObj = lObj;
}
