function chgImg(imgid, to){
	if(to==1){
		document.getElementById(imgid).src="img/"+imgid+"ON.png";
	} else{
		document.getElementById(imgid).src="img/"+imgid+".png";
	}
}

function chgSubTit(to, imgid, label){
	if(to==1){
		document.getElementById(imgid).src="img/"+imgid+label+"_on.png";
		//alert("img/"+imgid+label+"_on.png");
	} else{
		document.getElementById(imgid).src="img/"+imgid+label+".png";
		//alert("img/"+imgid+label+".png");
	}
}

var detect = navigator.userAgent.toLowerCase(); 
var browser,thestring; 

function getBrowser(){ 
	if (checkIt('msie') || checkIt('internet explorer')) browser = "IE"; 
	else if (!checkIt('compatible') || checkIt('firefox')){ 
		browser = "Mozilla"; 
    	if(checkIt('firefox')) 
        	browser="Firefox"; 
	} else browser = "Unknown"; 
	return browser; 
} 

function checkIt(string){ 
	place = detect.indexOf(string) + 1; 
	thestring = string; 
	return place; 
} 

////////////////////////// 
//These below handle FF N 
///////////////////////// 

function getImageXfromLeft(imgID) { 
  //if not using IE 
  if (getBrowser()!="IE") return document.getElementById(imgID).x; 
  else return getRealLeft(imgID);//else, using Internet explorer 
} 

function getImageYfromTop(imgID) { 
  if (getBrowser()!="IE") return document.getElementById(imgID).y; 
  else return getRealTop(imgID); 
} 

////////////////////////// 
//These below handle Internet explorer 
///////////////////////// 

function getRealLeft(imgElem) { 
    xPos = document.getElementById(imgElem).offsetLeft; 
    tempEl = document.getElementById(imgElem).offsetParent; 
      while (tempEl != null) { 
          xPos += tempEl.offsetLeft; 
          tempEl = tempEl.offsetParent; 
      } 
    return xPos; 
} 

function getRealTop(imgElem) {// 
    yPos = document.getElementById(imgElem).offsetTop; 
    tempEl = document.getElementById(imgElem).offsetParent; 
    while (tempEl != null) { 
          yPos += tempEl.offsetTop; 
          tempEl = tempEl.offsetParent; 
      } 
    return yPos; 
} 