function aagcInit(){
getSecondLevelPageName(strLegendPath);
}

function aagcHistoryGoBack(){
if(window.location.search.indexOf('Id=165') != -1){
history.go(-2)
}
else{
history.go(-1)
}
}
function getSecondLevelPageName(str){
//alert(str)
	var strRe;
	strRe = /<SPAN class="Legend">/gi;
	strLegendPath = strLegendPath.replace(strRe,'');

	strRe = /<\/SPAN>/gi;
	strLegendPath = strLegendPath.replace(strRe,'');

	strRe = / class=Legend/gi;
	strLegendPath = strLegendPath.replace(strRe,'');

	strRe = /<\/A>/gi;
	strLegendPath = strLegendPath.replace(strRe,'');

	strRe = /<A href="Default.asp\?ID=\d*"/gi;
	strLegendPath = strLegendPath.replace(strRe,'');

	strLegendPath = strLegendPath.substring(strLegendPath.indexOf('>')+1);
	var aLegendPath = strLegendPath.split('>');
	
	if(aLegendPath.length>=2){

		document.getElementById('oHTMLlevel2').innerHTML = aLegendPath[1];
document.getElementById('oHTMLlevel2').style.display= 'block';
	}
}

function redirectFrontpageCalender(){
var strTmp = window.location.search
if(strTmp.indexOf('CalenderEventID')!= -1){
strTmp = strTmp.substring(strTmp.indexOf('&'))
strTmp  = '/Default.asp?Id=165' + strTmp 
//alert(strTmp)
window.location.href = strTmp
//location.replace(strTmp)
}
}
redirectFrontpageCalender();

var blnWin = false;
function popImageWin(strSrc,intwidth,intHeight){

var strAtt = 'height='+intHeight+',width='+intwidth
if(!blnWin){
pictWin = window.open('','',strAtt)
blnWin = true;
}
else{
pictWin.close()
pictWin = window.open('','',strAtt)
}
pictWin.document.write('<html><head><title>Billeder</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src='+strSrc+'></body></html>');
}
