// JavaScript  for A touch of light Document


function DOMCall(name) {
	if (document.layers) 
		return document.layers[name];
	else if (document.all)
		return document.all[name];
	else if (document.getElementById)
		return document.getElementById(name);
}

function showPic (whichpic) {
	DOMCall('placeholder').src = whichpic.href;
	if (whichpic.title) {
		DOMCall('imageCaption').innerHTML = whichpic.title;
		DOMCall('imageCaption').className = "";
	} else {
		DOMCall('imageCaption').className = "hidden";
	}
 	return false;
}

function clickedImage (whichpic) {
	imageUrl = whichpic.src;  // grab the url of the medium image.
	/*imageUrl = imageUrl.replace(/images/gi, "images/large"); // add in the "large" dir so we can display the big picture
	imageWindow = window.open("popup.php?z="+imageUrl,'imageWin','width=640,height=480');  // popup the image in a new window set width and height to your max values*/
}

function switchPage(pageId) {
DOMCall('page1').className = "hidden";
DOMCall('page2').className = "hidden";


DOMCall(pageId).className = "asdasd"; // set the current page to junk so it becomes visible
}


function nothing() // dummy url
	{
	}

function non() 
	{
	alert("The menu links are non-functional");
	}

function montre(id) {
var d = document.getElementById(id);
        for (var i = 1; i<=10; i++) {
                if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none'; }
        }
if (d) {d.style.display='block';}
}


function SelectMenu(menuid) {
var p = DOMCall(menuid);
        for (var i = 1; i<=10; i++) {
		if (DOMCall('m'+i)) {DOMCall('m'+i).className = 'deselected';}
		}
if (p) {p.className='selected';}
}

function SelectSmenu(smid) {
var s = DOMCall(smid);
		for (var j = 1; j<=32; j++) {
		if (DOMCall('sm'+j)) {DOMCall('sm'+j).className = 'deselected';}
		}
if (s) {s.className='selected';}
}


function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

var comp;

function showhide(val)
{
	comp.style.visibility = val;
}



function start_doctor() {
	
	fnJsl10n();
	highlightPage('subnav');
	var lang = fnGetCookie('wawaL10n');
	if (lang == 'en') {SelectMenu('m2'); SelectSmenu('sm8'); montre('smenu2');}
	if (lang == 'fr') {SelectMenu('m5'); SelectSmenu('sm24'); montre('smenu5');}
    
}
function start_soins() {
	
	fnJsl10n();
	highlightPage('subnav');
	var lang = fnGetCookie('wawaL10n');
	if (lang == 'en') {SelectMenu('m3'); SelectSmenu('sm8'); montre('smenu3');}
	if (lang == 'fr') {SelectMenu('m6'); SelectSmenu('sm24'); montre('smenu6');}
    
}
function start_clinic() {
	load();
	fnJsl10n();
	highlightPage('subnav');
	var lang = fnGetCookie('wawaL10n');
	if (lang == 'en') {SelectMenu('m1'); SelectSmenu('sm8'); montre('smenu1');}
	if (lang == 'fr') {SelectMenu('m4'); SelectSmenu('sm24'); montre('smenu4');}
    
}
function start_short() {
	
	fnJsl10n();
	highlightPage('subnav');
    
}