var WindowObjectReference = null; // global variable

function openPopup(img)
{
  if(WindowObjectReference == null || WindowObjectReference.closed)
  /* if the pointer to the window object in memory does not exist
     or if such pointer exists but the window was closed */

  {
    WindowObjectReference = window.open(img,
   "", "resizable=yes,width=625,height=805,top=0,left=10,scrollbars=yes,status=yes");
    /* then create it. The new window will be created and
       will be brought on top of any other window. */
  }
  else
  {
    WindowObjectReference.focus();
    /* else the window reference must exist and the window
       is not closed; therefore, we can bring it back on top of any other
       window with the focus() method. There would be no need to re-create
       the window or to reload the referenced resource. */
  };
}

function switchTabs(tabNum, parentId) {
	var boxId = parentId.id;
	var tabs = document.getElementById(boxId).getElementsByTagName("li");
	for (var i = 0; i < tabs.length; i++) {
		var thisTab = tabs[i];
		if ((thisTab.id != "")) {
			document.getElementById(boxId+"_content"+i).style.display = "none";
			if (i == tabNum) {
				thisTab.className = "active";
				document.getElementById(boxId+"_content"+i).style.display = "block";
			} else if (i == (tabNum+1)) {
				thisTab.className = "active-right";
			} else if (i == (tabNum-1)) {
				thisTab.className = "active-left";
			} else {
				thisTab.className = "";
			}
		}
	}
}

function switchInfo(boxNum, parentId) {
	var boxId = parentId.id;
	var boxes = document.getElementById(boxId).getElementsByTagName("div");
		
	for (var i = 0; i < boxes.length; i++) {
		var thisBox = boxes[i];
		
		if ((thisBox.id != "")) {
			document.getElementById(boxId+"_content"+i).style.display = "none";
			if (i == boxNum) {
				//thisBox.className = "active";
				document.getElementById(boxId+"_content"+i).style.display = "block";
			}
		}
	}
}

function link(xSelf,xLinkID){
	document.location.href=xSelf + "?id=" + xLinkID;
}

sanskrit_on = new Image();
	sanskrit_on.src = "/images/main-sanskrit2.gif";
	sanskrit_off = new Image();
	sanskrit_off.src = "/images/main-sanskrit.gif";

csanskrit_on = new Image();
	csanskrit_on.src = "/images/class-sanskrit2.gif";
	csanskrit_off = new Image();
	csanskrit_off.src = "/images/class-sanskrit.gif";
	
bodywork_on = new Image();
	bodywork_on.src = "/images/main-bodywork2.gif";
	bodywork_off = new Image();
	bodywork_off.src = "/images/main-bodywork.gif";

cbodywork_on = new Image();
	cbodywork_on.src = "/images/class-bodywork2.gif";
	cbodywork_off = new Image();
	cbodywork_off.src = "/images/class-bodywork.gif";
	
yoga_on = new Image();
	yoga_on.src = "/images/main-yoga2.gif";
	yoga_off = new Image();
	yoga_off.src = "/images/main-yoga.gif";

cyoga_on = new Image();
	cyoga_on.src = "/images/class-yoga2.gif";
	cyoga_off = new Image();
	cyoga_off.src = "/images/class-yoga.gif";

nvcomm_on = new Image();
	nvcomm_on.src = "/images/main-nvcomm2.gif";
	nvcomm_off = new Image();
	nvcomm_off.src = "/images/main-nvcomm.gif";

cnvcomm_on = new Image();
	cnvcomm_on.src = "/images/class-nvcomm2.gif";
	cnvcomm_off = new Image();
	cnvcomm_off.src = "/images/class-nvcomm.gif";

function imgOn(IMG_ID) {
	document.getElementById(IMG_ID).src = eval(IMG_ID + "_on.src");
}

function imgOff(IMG_ID) {
	document.getElementById(IMG_ID).src = eval(IMG_ID + "_off.src");
}

function openWin(URL) {
	newWin = window.open(URL,'sample_win','status=no,menubar=no,toolbar=no,scrollbars=yes,address=0,resizable=no,width=770,height=800');
	if (newWin.opener == null) newWin.opener = window; 
	newWin.opener.name = "evyog_main";
	newWin.focus ();
	newWin.moveTo(0,0);
}

// Set the horizontal and vertical position for the popup
PositionX = 25;
PositionY = 25;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth  = 770;
defaultHeight = 800;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows
var AutoClose = false;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,status=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,status=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){

writeln('<style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=230-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');
writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=#000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('<meta http-equiv="imagetoolbar" content="no"></head><body bgcolor=000000 scroll="no" status="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()" onmousedown="self.close()">');
writeln('<img class="image_pop" name="George" src='+imageURL+' ');
writeln('style="display:block"><a href="javascript:self.close();">close [x]</a></body></html>');
close();                        
}}

 //-->