//this function is a image preloader and it can be called from the top off your form
function preloadImg(db, ImgObj, imgsrc){
        if ( document.images ){
	             eval( ImgObj + '= new Image()' )
              eval( ImgObj + '.src = "/' + db + '/img/banner/$file/' + imgsrc+ '.gif"' )
        }
}

//this function visually makes the button go down and up
var thisObj = ''
function pressIn(imgName){
        var curObj = document.all[imgName]
        thisObj = curObj
        curObj.src = but_on.src
        setTimeout('thisObj.src = but_off.src', 300 ) 
}

//this function opens a new window with the specified url, window name, width and height
function openWindow(url, wname, w, h) {
        var specs = 'toolbar=no, directories=no, status=no, resizable=no, scrollbars=no, width=' + w + ', height=' + h
        window.open(url,wname, specs)
	}

//this function calls the confirmation box asking what to do
function goUrl(db, action, url) {
        if( action == 'modify' || action == 'create' ) {
	             openWindow('/' + db + '/confirmation?OpenForm&gourl=/'+ db + '/' + url , 'confirmation', '175', '100')
        }
        else {
              window.location = '/' + db + '/' + url 
        }
}


//this function opens a window to show a message (2 lines max, 175 width...)
function messagetext(db, width, message ) {
	openWindow('/' + db + '/textpopup?OpenForm&text=' + message, 'info', width, '100')
}

