<!--

function preloadimages() {
  var i, j, imgFiles = preloadimages.arguments;
  if (document.images) {
   for (i=0; i < (preloadimages.arguments.length); i+=3) {
	  j = Math.round(i/3);
      preloadArray[j] = new Image(parseInt(imgFiles[i+1]),parseInt(imgFiles[i+2]));
      preloadArray[j].src = imagepath + imgFiles[i];
    }
  }
}

function swapImage() {
  if(loaded)	{
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.swapImgData;
  for (i=0; i < (swapImage.arguments.length); i+=2) {
	objName = swapImage.arguments[i];
	if (objName != '') {
	objStr = 'document.images.' + objName;
	obj=eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
	  obj.src = imagepath + swapImage.arguments[i+1] + '.gif';
  	} 
  }
  document.swapImgData = swapArray; //used for restore
}
}
}
function swapImgRestore() {
  if(loaded)	{
  if (document.swapImgData != null)
    for (var i=0; i<(document.swapImgData.length-1); i+=2)
      document.swapImgData[i].src = document.swapImgData[i+1];
}
}

/* POPUP SCRIPT V2.0*/

function isUndefined(v) {
var undef;
return v===undef;
}

var _POPUP_FEATURES = 'location=0, statusbar=0, menubar=0,scrollbars=0,width=400, height=300';

function raw_popup(url, target, features) {
if (isUndefined(features)) {
features = _POPUP_FEATURES;
}
if (isUndefined(target)) {
target = '_blank';
}
var theWindow = window.open(url, target, features);
theWindow.focus();
return theWindow;
}

function link_popup(src, features){
return raw_popup(src.getAttribute('href'), src.getAttribute('target') ||'_blank', features);
}



/* POPUP SCRIPT V1.0*/

var popupScroll='no';
var resizable='yes';
var theWidth1;
var theHeight1;
//var detailswin;

function open_Details_Window() {

		var theParameters = new Array(
		'theURL',
		'popupWidth',
		'popupHeight',
		'popupScroll',
		'resizable'
		
		);
	
	for (i=0; i < (open_Details_Window.arguments.length); i++) {
		theVar = theParameters[i];
		theValue = open_Details_Window.arguments[i];
		eval(theVar + "= theValue");
	}
	
	//detailswin.close();
	
	if (isOpen(detailswin))	{
			close_Details_Window(detailswin);
	}
	
	return(opendetails(theURL,popupWidth,popupHeight,popupScroll,resizable));
}

function open_Details_Window1() {
		

	var theParameters = new Array(
		'theURL',
		'popupWidth',
		'popupHeight',
		'popupScroll',
		'resizable'
		
		);
	
	for (i=0; i < (open_Details_Window1.arguments.length); i++) {
		theVar = theParameters[i];
		theValue = open_Details_Window1.arguments[i];
		eval(theVar + "= theValue");
	}

	
			//detailswin.close();
	
if (isOpen(detailswin))	{
			close_Details_Window(detailswin);
	}
	opendetails(theURL,popupWidth,popupHeight,popupScroll,resizable);
}

function opendetails(theURL,theWidth,theHeight,theScroll,theResizable)	{
theWidth1 = theWidth;
theHeight1 = theHeight;

detailsDetails = 'scrollbars=' + theScroll + ',resizable=' + theResizable + ',width=' + theWidth + ',height=' + theHeight +  ',left=100,top=40';
detailswin=window.open(theURL,'imagedetails',detailsDetails);
		openeddetails=true;
if (window.focus) {detailswin.focus()}
return(detailswin);


}

function close_win()	{
	close_Details_Window(detailswin);
}

function close_Details_Window(theWin)	{
	if (theWin) {
		theWin.close()
		}
}

function close_Details_Window1(theWin)	{
	if (theWin) {
		theWin.close()
		}
}

function isOpen(theWindow)	{
	var isItOpen=false;
	if(theWindow)	{
		if(theWindow.closed==false)	{
			isItOpen=true;
		}
	}
	return isItOpen;
}


//-->
