// Images FlipFlop
var imgArr = new Array;

//version1
var imgIndex = 0;
function loadImg(URL) {
  imgArr[imgIndex] = new Image;
  imgArr[imgIndex].src = URL;
  imgIndex++;
}

function setImg(imgName, URL) {
 document[imgName].src = URL;
 return true;
}
//version2
var imgBaseURL = "/img/";
function setImage(name, state) {
 document[name].src = imgArr[name + state].src;
 return true;
}
function loadImages(names) {
 for (var i = 0; i < names.length; i++) {
  var name = names[i];
  imgArr[name] = new Image();
  imgArr[name + "1"] = new Image();
  imgArr[name].src = imgBaseURL + name + ".gif";
  imgArr[name + "1"].src = imgBaseURL + name + "1.gif";
 }
}
// /Images FlipFlop

function openWnd(URL,w,h)
{
 wndName = "";
 for(i=0; c = URL.charAt(i); i++) {
  if(c=="." || c=="%" || c=="/" || c=="=" || c=="?" || c==",") c = "_"; 
  wndName = wndName + c;
 }
 wndFeat = "width=" + w + ",height=" + h;// + ",scrollbars=1";
 wnd = open(URL, wndName, wndFeat); wnd.focus();
 return false;
}//openWnd(URL,w,h)


function openSWnd(URL,w,h)
{
wndName = "sswindow";
wndFeat = "width=" + w + ",height=" + h + ",scrollbars=1";
//alert(URL + "\r\n" + wndName + "\r\n" + wndFeat)
swnd = open(URL, wndName, wndFeat); swnd.focus();
return false;
}//openSWnd(URL,w,h)


function openWndP1(URL,w,h)
{
if(w>screen.availWidth) w = screen.availWidth - 40; 
if(h>screen.availHeight) h = screen.availHeight - 120; 
wndName = "sswindow";
wndFeat = "width=" + w + ",height=" + h + ",scrollbars=1,resizable=1,menubar=1,status=1";
swnd = open(URL, wndName, wndFeat); swnd.focus();
return false;
}//openWndP1(URL,w,h)


// toggleNode
function tglNd(anID) {
	aName = "a" + anID;
	sName = "s" + anID;
	if(document.all != null && document.all[aName]!=null) {
		if(document.all[aName].style.display=="") {
			document.all[aName].style.display="none";
			document[sName].src = "../img/p.gif";
		} else {
			document.all[aName].style.display="";
			document[sName].src = "../img/m.gif";
		}
	}else{
		return true;
		if(document.anchors[aName].style.display=="") {
			document.anchors[aName].style.display="none";
			document[sName].src = "../img/p.gif";
		} else {
			document.anchors[aName].style.display="";
			document[sName].src = "../img/m.gif";
		} 
	}
	return false;
}
// /toggleNode

function menufirston(a,b,c)
{
document.getElementById(a).style.backgroundImage = 'url(images/menunextlefton.gif)'; 
document.getElementById(b).style.backgroundImage = 'url(images/menunexton.gif)'; 
document.getElementById(c).style.backgroundImage = 'url(images/menunextrighton.gif)';
}
function menufirstoff(a,b,c)
{
document.getElementById(a).style.backgroundImage = 'url(images/menufirstnone.gif)'; 
document.getElementById(b).style.backgroundImage = 'none'; 
document.getElementById(c).style.backgroundImage = 'url(images/menunextnone.gif)';
}
function menuon(a,b,c)
{
document.getElementById(a).style.backgroundImage = 'url(images/menunextlefton.gif)'; 
document.getElementById(b).style.backgroundImage = 'url(images/menunexton.gif)'; 
document.getElementById(c).style.backgroundImage = 'url(images/menunextrighton.gif)';
}
function menuoff(a,b,c)
{
document.getElementById(a).style.backgroundImage = 'url(images/menunextnone.gif)'; 
document.getElementById(b).style.backgroundImage = 'none'; 
document.getElementById(c).style.backgroundImage = 'url(images/menunextnone.gif)';
}

