// JavaScript Document


//preload both images
var img1,img2;
if(document.images){
img1 = new Image();
img1.src = "/GRAPHICS/COMMON/plus_blue.png";
img2 = new Image();
img2.src = "/GRAPHICS/COMMON/minus_blue.png";
}


//function to perform the swap
function swapImage1(){
//get referrence to the image element
var img = document.getElementById("imgEl");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage2(){
//get referrence to the image element
var img = document.getElementById("imgE2");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage3(){
//get referrence to the image element
var img = document.getElementById("imgE3");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage4(){
//get referrence to the image element
var img = document.getElementById("imgE4");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}
//function to perform the swap
function swapImage5(){
//get referrence to the image element
var img = document.getElementById("imgE5");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage6(){
//get referrence to the image element
var img = document.getElementById("imgE6");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage7(){
//get referrence to the image element
var img = document.getElementById("imgE7");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage8(){
//get referrence to the image element
var img = document.getElementById("imgE8");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage9(){
//get referrence to the image element
var img = document.getElementById("imgE9");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage10(){
//get referrence to the image element
var img = document.getElementById("imgE10");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage11(){
//get referrence to the image element
var img = document.getElementById("imgE11");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage12(){
//get referrence to the image element
var img = document.getElementById("imgE12");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage13(){
//get referrence to the image element
var img = document.getElementById("imgE13");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage14(){
//get referrence to the image element
var img = document.getElementById("imgE14");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage15(){
//get referrence to the image element
var img = document.getElementById("imgE15");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage16(){
//get referrence to the image element
var img = document.getElementById("imgE16");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage17(){
//get referrence to the image element
var img = document.getElementById("imgE17");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage18(){
//get referrence to the image element
var img = document.getElementById("imgE18");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage19(){
//get referrence to the image element
var img = document.getElementById("imgE19");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}


//function to perform the swap
function swapImage20(){
//get referrence to the image element
var img = document.getElementById("imgE20");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage21(){
//get referrence to the image element
var img = document.getElementById("imgE21");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage22(){
//get referrence to the image element
var img = document.getElementById("imgE22");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage23(){
//get referrence to the image element
var img = document.getElementById("imgE23");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}


//function to perform the swap
function swapImage24(){
//get referrence to the image element
var img = document.getElementById("imgE24");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}


//function to perform the swap
function swapImage25(){
//get referrence to the image element
var img = document.getElementById("imgE25");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage26(){
//get referrence to the image element
var img = document.getElementById("imgE26");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage27(){
//get referrence to the image element
var img = document.getElementById("imgE27");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage28(){
//get referrence to the image element
var img = document.getElementById("imgE28");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage29(){
//get referrence to the image element
var img = document.getElementById("imgE29");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage30(){
//get referrence to the image element
var img = document.getElementById("imgE30");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage31(){
//get referrence to the image element
var img = document.getElementById("imgE31");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

//function to perform the swap
function swapImage32(){
//get referrence to the image element
var img = document.getElementById("imgE32");
//now perform the test
if(img.src.indexOf("plus")>-1){
img.src = img2.src;
}else{
img.src = img1.src;
}
}

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined")
revivecontent()
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate


