	function toTop(id){
	document.getElementById(id).scrollTop=0
	}

	defaultStep=1
	step=defaultStep
	function scrollDivDown(id){
	document.getElementById(id).scrollTop+=step
	timerDown=setTimeout("scrollDivDown('"+id+"')",10)
	}

	function scrollDivUp(id)
	{
	
	document.getElementById(id).scrollTop-=step
	timerUp=setTimeout("scrollDivUp('"+id+"')",10)
	}

	function toBottom(id){
	document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight
	}

	function toPoint(id){
	document.getElementById(id).scrollTop=100
	}
/*Open Window*/
	function open_window(url, w, h) {
	email = window.open(url,"Preview",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=YES,width='+w+',height='+h);
	}


/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

*/

// Only used in IE6
var isIE6 = true;

for(var i=0; i<document.images.length; i++)
 {
    var img = document.images[i]
    var imgName = img.src.toUpperCase()
    if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
    {
       var imgID = (img.id) ? "id='" + img.id + "' " : ""
       var imgClass = (img.className) ? "class='" + img.className + "' " : ""
       var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
       var imgStyle = "display:inline-block;" + img.style.cssText 
       if (img.align == "left") imgStyle = "float:left;" + imgStyle
       if (img.align == "right") imgStyle = "float:right;" + imgStyle
       if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
       var strNewHTML = "<span " + imgID + imgClass + imgTitle
       + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
       + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
       + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
       img.outerHTML = strNewHTML
       i = i-1
    }
 }
 
 /*
 sfHover = function() {
 	// this line was changed to remove the error
 	// var sfEls = document.getElementById("Nav").getElementsByTagName("LI") ;
 	
 	var sfEls = document.getElementById("Nav").getElementsByTagName("LI") ;
 	for (var i=0; i<sfEls.length; i++) {
 		sfEls[i].onmouseover=function() {
 			this.className+=" sfhover";
 		}
 		sfEls[i].onmouseout=function() {
 			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
 		}
 	}
 }
 if (window.attachEvent) window.attachEvent("onload", sfHover); 
 
 */
 
 function toggle(objBodyEle){
 			if (document.getElementById(objBodyEle).className=='bodyClose'){
 				document.getElementById(objBodyEle).className='bodyOpen';
 			}else{
 				document.getElementById(objBodyEle).className='bodyClose';
 			}
 		}
 
 
 function addSinglePartTag(tagName, prompt, defaultText)
 {
   // If something is selected then just encase it in the tags
   var selection = document.selection.createRange().text;
   if(selection != "")
   {
     self.editform.message.focus();
     var newSelection = document.selection.createRange();
 	  newSelection.text 
 = '<'+tagName+'>'+selection+'</'+tagName+'>';
 	  return;
   }
 
   // Nothing's selected so prompt for something to put between the tags
   alert("Highlight the required text") ;
}

function deleteconf() {
	// alert("pmode is " + document.getElementById("pmode").value) ;
	var answer = confirm("Delete this file, are you absolutely sure?")
	if (answer){
		// change the form mode and submit the form
		document.getElementById("pmode").value = 'delete' ;
		document.imageupload.submit() ;
	}
	
}


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_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
//alert(mm_swapimage.arguments[2]);
  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];}
}


