<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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

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_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_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];}
}

function clearDefaultText(defaultText, el) {
 if(el.value == defaultText){
  el.value = "";
 }
}


/* POP UP PICUTRES */


var offsetfrommouse=[15,25];
var whichWindow;
var lastWindow = null;
var popInWay = false


defaultimagewidth = 400;
defaultimageheight = 400;

function showPreviewWindow(windowItem, imageItem, imageSource, dwidth, dheight){
 document.getElementById(imageItem).src = imageSource;
 defaultimagewidth  = dwidth;   //parseInt(document.getElementById(imageItem).style.width.replace("px", ""));
 defaultimageheight = dheight;  //parseInt(document.getElementById(imageItem).style.height.replace("px", ""));
  whichWindow = windowItem;
 var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth - offsetfrommouse[0];
  var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight);
 if((navigator.userAgent.indexOf("Konqueror") == -1  || navigator.userAgent.indexOf("Firefox") != -1 || (navigator.userAgent.indexOf("Opera") == -1 && navigator.appVersion.indexOf("MSIE") != -1)) && (docwidth>650 && docheight>500)){
  if(popInWay == false){
   if(lastWindow != null){
    document.getElementById(lastWindow).style.display = 'none';
   }
   document.onmousemove = followmouse; 
   setTimeout("document.getElementById(whichWindow).style.display = 'block'", 200);
   lastWindow = whichWindow;
  }
 }
}

function hidePreviewWindow(closeWindow, imageItem, imageSource){
 document.getElementById(imageItem).src = imageSource;
 if(popInWay == false){
  document.getElementById(closeWindow).style.display = 'none';
  document.onmousemove = "";
  gettrailobj().top  = "-500px";
 }
}

function gettrailobj(){
 if (document.getElementById){
  return document.getElementById(whichWindow).style
 }
}

function truebody(){
 return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function followmouse(e){
 var xcoord=offsetfrommouse[0];
  var ycoord=offsetfrommouse[1];
 var docwidth  = document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
 var docheight = document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)

 if(typeof e != "undefined"){

  if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
   xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
  }else{
   xcoord += e.pageX;
  }
  if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
   ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
  }else{
   ycoord += e.pageY;
  }

 }else if(typeof window.event != "undefined"){

  if(docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
   xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
  }else{
   xcoord += truebody().scrollLeft+event.clientX
  }
  if(docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
   ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
  } else {
   ycoord += truebody().scrollTop + event.clientY;
  }

 }

 var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
 var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

 gettrailobj().left = xcoord + "px";
 gettrailobj().top  = ycoord + "px";
}

//-->