/*** click only once for forms ***/
function oneclick(theform){
if (document.all||document.getElementById){
  for (i=0;i<theform.length;i++){
  var tempobj=theform.elements[i]
    if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
    tempobj.disabled=true
  }
} else
return false
}

/*** broadcast message ***/
/*** did cause object expected error with doctype turned on before new copy from web ***/
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}

// JavaScript to pop a new window
function popper(thisUrl,thisWindow,thisWidth,thisHeight,thisTop,thisLeft) {
	optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=yes,menubar=no,resizable=no,scrollbars=yes');

    mainWin = window.open(thisUrl,thisWindow,optionString);
	mainWin.focus();

}

// JavaScript to pop a new window with no scrollbars
function noscrollpopper(thisUrl,thisWindow,thisWidth,thisHeight,thisTop,thisLeft) {
	optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=yes,menubar=no,resizable=no,scrollbars=no');

    mainWin = window.open(thisUrl,thisWindow,optionString);
	mainWin.focus();

}

// JavaScript for Search Block
function wordsplit(items) 
               {	var charect = "";
			for (var n = 1 ; n <= items.length ; n++) 
				{	if (items.substring(n - 1, n) == " ") 
				{	charect += "+"; }
			else 
                     {	charect += items.substring(n - 1, n);
				}
				}
			return charect;
		}

function search()
               {	if (document.searching.query.value != "")
			{	var keywords = document.searching.query.value;   }
                  else
                  {	
                     return
                  }
                  var searchurl = "";

                  key = wordsplit(keywords);
                  for (index = 0; index < document.searching.searchEngine.length; index++)
                  {
                     if (document.searching.searchEngine[index].checked)
                     {
                        searchurl = document.searching.searchEngine[index].value;
                        break;
                     }
                  } 

                  searchurl += key;
                  if (document.searching.newwind.checked)
                  {
                     wind = window.open(searchurl, "SearchResults");
                  }
                  else
                  {
                     window.location.href = searchurl;
                  }
               }
               
function reset()
               {
                  searching.query.text = "";
                  searching.searchEngine[0].checked = true;
               }
            //-->

/*** Display icons ***/ 
/*** By On March 2006 ***/ 

function showimage() 
{ 
if (!document.images) 
return 
document.images.icons.src= 
document.myfishy.icon.options[document.myfishy.icon.selectedIndex].value 
} 
