// JavaScript Document

var about = new Array();
about[0]=['About Us','about-us.html']
about[1]=['Vision &amp; Mission','visionandmission.html'];
about[2]=['The Director\'s Message','message.html'];
about[3]=['Achievements','achievements.html'];
about[4]=['Awards &amp; Recognition','awards.html'];
about[5]=['Team BACC','team.html'];



var services = new Array();
services[0]=['Infertility Management','infertility-services.html'];
services[1]=['Maternity Services','maternity-services.html'];
services[2]=['Gynaecological Services','gynaecological-services.html'];
services[3]=['Gynaecological Surgeries','gynaecological-surgeries.html'];
services[4]=['Cytogenetics &amp; Molecular Diagnostic Services','cytogenetics.html'];
services[5]=['Prenatal Diagnostic Facilities &amp; Services','prenatal-diagnostic.html'];
services[6]=['NICU','nicu.html'];
services[7]=['BACC Health Care Packages','bacc-health-care.html'];
services[8]=['Education - Training - Research','education-training-research.html'];
services[9]=['Corporate Social Responsibility','corporate-social-responsibility.html'];




var Medinfo = new Array();
Medinfo[0]=['Understanding Conception','understanding-conception.html'];
Medinfo[1]=['Intrauterine Insemination','intrauterine-insemination.html'];
Medinfo[2]=['Hysteroscopy','hysteroscopy.html'];
Medinfo[3]=['Laparoscopy','laparoscopy.html'];
Medinfo[4]=['IVF - ET','ivf-et.html'];
Medinfo[5]=['Fibroids','fibroids.html'];
Medinfo[6]=['Endometriosis','endometriosis.html'];
Medinfo[7]=['Male Infertility','male-infertility.html'];
Medinfo[8]=['Intra Cyto plsmic Sperm Injection','intracytoplsmic-sperm-injection.html'];



//Medinfo[3]=['Donor Egg','donor-egg.html'];
//Medinfo[4]=['Amniocentesis','amniocentesis.html'];
//Medinfo[5]=['Pregnancy Loss Program','pregnancy-loss-program.html'];

	
	
var tourism = new Array();
tourism[0]=['Facilities &amp; Procedures','#'];
tourism[1]=['Primary Form','#'];
tourism[2]=['Ask BACC','#'];
tourism[3]=['Link to Medical Tourism','#'];

var patients = new Array();
patients[0]=['Infertility','faqs.html'];
patients[1]=['Myths &amp; Misconceptions','infertility-myths.html'];
patients[2]=['Endometriosis','endometriosis-faqs.html'];
patients[3]=['Breast Feeding','breast-feeding.html'];
patients[4]=['Enquiry Form','enquiry.html'];
//patients[5]=['Feedback Form','feedback.html'];


var bank = new Array();
bank[0]=['Books Publication','books-publication.html'];
bank[1]=['Books Contributions','books-contributions.html'];
bank[2]=['Journals Contributions','journals-contributions.html'];
//bank[3]=['Books Ordering','books-ordering.html'];


document.write('<div id="div0" class="menu">');
for(i=0; i<about.length; i++)
{document.write('<a href="'+about[i][1]+'">'+about[i][0]+'</a>')}
document.write('</div>');

document.write('<div id="div1" class="menu">');
for(i=0; i<services.length; i++)
{document.write('<a href="'+services[i][1]+'">'+services[i][0]+'</a>')}
document.write('</div>');


document.write('<div id="div2" class="menu">');
for(i=0; i<Medinfo.length; i++)
{document.write('<a href="'+Medinfo[i][1]+'">'+Medinfo[i][0]+'</a>')}
document.write('</div>');

document.write('<div id="div3" class="menu">');
for(i=0; i<tourism.length; i++)
{document.write('<a href="'+tourism[i][1]+'">'+tourism[i][0]+'</a>')}
document.write('</div>');

document.write('<div id="div4" class="menu">');
for(i=0; i<patients.length; i++)
{document.write('<a href="'+patients[i][1]+'">'+patients[i][0]+'</a>')}
document.write('</div>');

document.write('<div id="div5" class="menu">');
for(i=0; i<bank.length; i++)
{document.write('<a href="'+bank[i][1]+'">'+bank[i][0]+'</a>')}
document.write('</div>');



var ie4=document.all;
var dom=document.getElementById &&! ie4;
var ns4 = document.layers;
var opera = navigator.userAgent.indexOf('opera') != -1

var menuobj = null;

function iecompat()
{ return (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body; }

function gety(what)
{ var objtop = what.offsetTop;
  var objp = what.offsetParent;
  
  while(objp)
  { objtop = objtop+objp.offsetTop;
    objp = objp.offsetParent;
  }
  return objtop;

}

function gettoppos(what, offsettype)
{ var topy = gety(what);
  var winheight = (!opera)? iecompat().scrollTop+iecompat().clientHeight : window.pageYOffset+window.innerHeight;
  var maxheight = topy+menuobj.offsetHeight;
  
  if(winheight < maxheight)
  { var objy = (topy+what.offsetHeight)-(menuobj.offsetHeight);
 }
  else{objy = topy+what.offsetHeight;}
  
  return objy;
}

function getx(what)
{ var objleft = what.offsetLeft;
  var objp = what.offsetParent;
  while(objp)
  { objleft = objleft+objp.offsetLeft;
    objp = objp.offsetParent;
  }
	return objleft;	
}

function getleftpos(what, offsettype)
{ var leftx = getx(what);
  var winwidth = (!opera)? iecompat().scrollLeft+iecompat().clientWidth : window.pageXOffset+window.innerWidth;
  var maxwidth = leftx+menuobj.offsetWidth;
  
  if(winwidth < maxwidth)
  { var objx = (winwidth) - (menuobj.offsetWidth+what.offsetWidth);}
  else
  {objx = leftx;}
  return objx;
  }


function dropmenu(obj,e)
{  if(window.event) window.event.cancelBubble=true;
   else if(e.stopPropagation) e.stopPropagation();
   
   if(menuobj != null)
   {hidemenu();}
   
   menuobj = document.getElementById(obj.rel)
   cleardelay()
   
   if(ie4 || dom)
   {menuobj.style.visibility="visible";
    menuobj.style.top = gettoppos(obj,"top")+"px"; 
	menuobj.style.left = getleftpos(obj,"left")+"px"; 
	}
	
	if(ns4)
   {menuobj.visibility="visible";
    menuobj.clip.top = gettoppos(obj,"top")+"px"; 
	menuobj.clip.left = getleftpos(obj,"left")+"px"; 
	}
	
	if(opera)
   {menuobj.style.visibility="visible";
    menuobj.style.pixelTop = gettoppos(obj,"top")+"px"; 
	menuobj.style.pixelLeft = getleftpos(obj,"left")+"px"; 
	}
   
   menuobj.onmouseover=function()
   {cleardelay();
    prev = obj.className;
   	obj.className = "current"; 
	}
	
   menuobj.onmouseout=function()
   {delayhide();
   obj.className = prev ;}


}

function delayhide()
{stopit = setTimeout('hidemenu()',200);}

function hidemenu()
{menuobj.style.visibility="hidden";}

function cleardelay()
{ if(typeof stopit != "undefined")
	clearTimeout(stopit);
}


function imagewin(img,w,h)
{   if (typeof win != "undefined")
    { win.close(); }
	
	 var topy = parseInt((window.screen.availHeight / 2) - (h / 2));
    var leftx = parseInt((window.screen.availWidth / 2) - (w / 2));
	
	var win = window.open('','','width='+w+',height='+h+',top=' + topy + ',left=' + leftx + ',screenX=' + leftx + ',screenY=' + topy + ',scrollbars=yes ');
	
	win.document.open();
	win.document.write('<html><body topmargin="0px" leftmargin="0px"><img src="'+img+'" /></body></html>');
	win.document.close();
	win.focus();
}

function newwindow(url,w,h)
{
	var topy = parseInt((window.screen.availHeight/2)-(h/2));
	var leftx = parseInt((window.screen.availWidth/2)-(w/2));

	if(typeof win != "undefined")
	{win.close();}
	
	win = window.open(url,'win1','width='+w+',height='+h+',top='+topy+',left='+leftx+',screenX='+leftx+',screenY='+topy+', scrollbars=yes ');
	
	win.focus();
}

/* ------------------------------------------------------------------------------------ */

function toggle(obj)
 {	var dobj = document.getElementById(obj.rel);
	 if(getDislayStatus(dobj)=="block" || getDislayStatus(dobj)=="")
	 { dobj.style.display="none"; obj.className="collapse";}
	 else
	 { dobj.style.display="block"; obj.className="expand";}
	 
	 return false;
}

function accordion(obj)
 {	
 	var pdiv = obj.parentNode.parentNode;
	var links = pdiv.getElementsByTagName('A');
	

	for(j=0; j<links.length; j++)
	{
		if(links[j] && links[j].rel)
		{document.getElementById(links[j].rel).style.display="none";
		 links[j].className="";
		 }
	}
	//alert(links.length);
	
 	document.getElementById(obj.rel).style.display="block";
	obj.className="current";
	/* if(getDislayStatus(dobj)=="block" || getDislayStatus(dobj)=="")
	 { dobj.style.display="none"; obj.className="collapse";}
	 else
	 { dobj.style.display="block"; obj.className="expand";}
	 */
	 return false;
}

 function getDislayStatus(obj)
 {
	 if(document.body.currentStyle)
	 { return obj.currentStyle.display;}
	 else if(window.getComputedStyle)
	 { return document.defaultView.getComputedStyle(obj,'').getPropertyValue('display');}
	else if(document.body.style)
	{ return obj.style.display;}
} 
