// gsvet.js
var root=location.href.substring(0,location.href.lastIndexOf('/') + 1);
//***
function initMainMenu(Id)
{
	if(isParent('content'))
	{
		var tblHeight=document.getElementById('tbl').clientHeight+20;
		parent.document.getElementById('content').style.height=tblHeight+'px';
		updateMainMenu(Id);
		updateUtMenu();
		parent.backToTop();
	}
	else
	{
		window.location.href=root+'index.html';
	}
}
//***
function updateMainMenu(Id)
{
	var mainArr=parent.mainNavArr;
	var c=mainArr.length;

	//for(var i=0;i<mainArr.length;i++)
	for(var i=0;i<c;i++)
	{
 		parent.document.getElementById(mainArr[i]).className='item';
	}
	if(Id)
	{
		parent.document.getElementById(Id).className='itemSelected';
	}
}
//***
function initUtMenu(Id)
{
	if(isParent('content'))
	{
		var tblHeight=document.getElementById('tbl').clientHeight+10;
		parent.document.getElementById('content').style.height=tblHeight+'px';
		updateMainMenu();
		updateUtMenu(Id);
		parent.backToTop();
	}
	else
	{
		window.location.href=root+'/';
	}
	if(isParent('content'))
	{
		convertEmail();
	}
}
//***
function updateUtMenu(Id)
{
	var utArr=parent.utNavArr;
	var c=utArr.length;
	for(var i=0;i<c;i++)
	{
 		parent.document.getElementById(utArr[i]).className='utItem';
	}
	if(Id)
	{
  	parent.document.getElementById(Id).className='utItem selectedUtItem';
	}
}
//***
function isParent(Id)
{
 var result=true;
 if(!parent.document.getElementById(Id))
 {
	result=false;
 }
 return result;
}
//***
function goToTop()
{
	parent.backToTop();
}
//***
function convertEmail()
{
	if(document.getElementById('tblContent'))
	{
		if(document.getElementById('tblContent').innerHTML.search(/info@gsv/i))
		{
			var em='@g'+'re'+'ats'+'out'+'h'+'vet'+'s.c'+'o.n'+'z';				document.getElementById('tblContent').innerHTML=document.getElementById('tblContent').innerHTML.replace(/@gsv/gi,em);
		}
	}
}
var findusGSVMapWin=null;
function findusGSVMap()
{
	if(findusGSVMapWin&&!findusGSVMapWin.closed)
	{
		findusGSVMapWin.close();
		findusGSVMapWin=null;
	}
	var w0=window.screen.width;
	var h=window.screen.height;
	w=700;
	r=Math.round((w0-w)/2);
	h=h-94;
	findusGSVMapWin=window.open('findusGSVMap.html','findusGSVMapWin','scrollbars,width='+w+',height='+h+',top=0,left='+r+',status');
}
//***
function findUsClick()
{
	parent.document.getElementById('findus').click();
}
//***
function deleteElContent(elId)
{
	if(window.navigator.appName.indexOf('Microsoft')==-1)
  {
  	document.getElementById(elId).innerHTML='';
  }
}
//***
//called when click on staff image in vets and nurses page does nothing may use one day
function imgEditClick(img)
{
  //alert('You clicked me');
}
//***
function ieBook()
{
	if(window.navigator.appName.indexOf('Microsoft')==-1)
  	{
		document.getElementById('ieBook').innerHTML='';
	}
}
//***

