/*
********************************************************
basic.js

  Application: 	French Drawings Collection
  Purpose: 	Frequently used javascript functions.
  Author:	Darrell Gray, Altered Image

********************************************************
*/

function page_reload(target) {
  x = window.location.replace(target) ;
  return true ;
}

function page_alert(target) {
  x = alert(target) ;
  return true ;
}

function time_alert(time,target) {
  x = window.setTimeout("alert('" + target + "');",time) ;
  return true ;
}

function time_reload(time,target) {
  x = window.setTimeout("window.location.replace('" + target + "');",time) ;
  return true ;
}

function set_value(InField,Value){
  thisField = eval("window.document.forms[0]." + InField) ;
  thisField.value = Value ;
  return true ;
}

function Picker(InField,ThisOne){
  thisField = eval("window.document.forms[0]." + InField) ;
  thisField.options.selectedIndex  = 0 ;
  for (i=0 ; i < thisField.length; i++) { 
    if (thisField.options[i].value == ThisOne) {
      thisField.options[i].selected = true ;
      }
    }
  return true ;
}

function Picker2(InField,ThisOne){
  thisField = eval("window.document.forms[1]." + InField) ;
  thisField.options.selectedIndex  = 0 ;
  for (i=0 ; i < thisField.length; i++) { 
    if (thisField.options[i].value == ThisOne) {
      thisField.options[i].selected = true ;
      }
    }
  return true ;
}
function Flipper(InField,ThisOne){
	thisField = eval("window.document.forms[0]." + InField) ;
	thisField[0].click() ;
	for (i=0 ; i < thisField.length; i++) { 
		if (thisField[i].value == ThisOne) {
			thisField[i].click() ;
		}
	}
}

function pop_window(name,url){
  opts = "width=450,height=300,toolbar=0,status=0" ;
  win = window.open(url,name,opts) ;
}
