// manage alternate navigation for disabled people
var strNaviInstance = "";

function CheckBlindNavi() 
{
	if (strNaviInstance != "" && strNaviInstance != null)
		document.location.href = "default.aspx?pageid=68&" + strNaviInstance;
	else
		document.location.href = "default.aspx?pageid=68";
}


function Del(message,ControlID)
{
	if(confirm(message)){
		__doPostBack(ControlID,'');
	}
}


// manage search 
function DoSearch(PageId, SearchValue, SearchIn, Xsl) 
{
	if (Xsl != null && Xsl != '')
		document.location.href = "default.aspx?pageid=" + PageId + "&XXHsi=" + SearchIn + "&XXHsv=" + SearchValue + "&XXHxs=" +  Xsl;
	else
		document.location.href = "default.aspx?pageid=" + PageId + "&XXHsi=" + SearchIn + "&XXHsv=" + SearchValue;
}


// manage search enter key press
function HitSearchEnter(InpField, PageId, SearchIn, Xsl)
{
  if(parseInt(window.event.keyCode) == 13)
  {

     	event.returnValue = false;
     	if (Xsl == null || Xsl == '')
     		DoSearch(PageId, document.getElementById(InpField).value, SearchIn, '');
     	else
     		DoSearch(PageId, document.getElementById(InpField).value, SearchIn, xsl);
  }
}


function OpenWin(URL,title,Height,Width,dir,loc,men,res,scroll,stat,tool){
	var OffsetH =Math.round(Height/2);
	var OffsetW =Math.round(Width/2);
	var H = (screen.height/2) - OffsetH;
	var W = (screen.width/2)-OffsetW;
	var Props='';
	Props += 'height=' + Height +',width=' + Width +',top=' + H +',left=' +W;
	Props += dir==1 ? ',directories=yes':',directories=no'
	Props += loc==1 ? ',location=yes':',location=no'
	Props += men==1 ? ',menubar=yes':',menubar=no'
	Props += res==1 ? ',resizable=yes':',resizable=no'
	Props += scroll==1 ? ',scrollbars=yes':',scrollbars=no'
	Props += stat==1 ? ',status=yes':',status=no'
	Props += tool==1 ? ',toolbar=yes':',toolbar=no'
	var win = window.open(URL,title,Props);
	win.focus();
}


//Opens the given URL in a new Window with the top and left coordinates 
// 1 means the porperty is on 
// 0 means the property is off 
function OpenWinPos(URL,title,Height,Width,Top,Left,dir,loc,men,res,scroll,stat,tool){
	var T = screen.height - Height;
	var L = screen.width - Width;
	if (Top < 1)
	{
		T = 1;
	}
	else if (Top < T)
	{
		T = Top;
	}
	if (Left < 1)
	{
		L = 1;
	}
	else if (Left < L)
	{
		L = Left;
	}
	var Props='';
	Props += 'height=' + Height +',width=' + Width +',top=' + T +',left=' + L;
	Props += dir==1 ? ',directories=yes':',directories=no'
	Props += loc==1 ? ',location=yes':',location=no'
	Props += men==1 ? ',menubar=yes':',menubar=no'
	Props += res==1 ? ',resizable=yes':',resizable=no'
	Props += scroll==1 ? ',scrollbars=yes':',scrollbars=no'
	Props += stat==1 ? ',status=yes':',status=no'
	Props += tool==1 ? ',toolbar=yes':',toolbar=no'
	var win = window.open(URL,title,Props);
	win.focus();
}


//#3.5 moved from default.aspx
function HICloseWindow()
{
      document.location.reload();	
}


/*
call the function like:

<A href="Javascript:addBookmark('YOURTITEL','');">Lesezeichen</A>
*/
function addBookmark(title, url) 
{
	if (window.sidebar) 
	{ 
		window.sidebar.addPanel(title, url,""); 
	} 
	else if( document.all ) 
	{
		window.external.AddFavorite(location.protocol + "//" + location.hostname + location.pathname + location.search + location.hash,title);
	} 
	else if( window.opera && window.print ) 
	{
		return true;
	}
}



/*
call the function like:

<A href="Javascript:SendPage();">send pagelink</A>
*/
function SendPage() 
{
	var strUrl = "InternalControls/HIRecommendPage/Web/HIRecommendPage.aspx?HIRPurl=" + location.protocol + "//" + location.hostname + location.pathname + location.search + location.hash;
	OpenWin(strUrl,'SendLink',600,800,0,0,0,0,1,0,0);
}
		
/*
call the function like:

<A href="Javascript:PrintPage();">[ Drucken ]</A>
*/
function PrintPage() 
{
	var strUrl = location.protocol + "//" + location.hostname + location.pathname + location.search + location.hash + "&hiath=Print";
	
	OpenWin(strUrl,'PrintPage',600,800,0,0,0,0,1,0,0);
}
		
