// zu Favoriten hinzufügen
function addfavorit(url,titel,subtitel)
{
	var navi;
	if (document.getElementById)	navi="NS6";
	if (document.layers)		navi="NS";
	if (document.all)		navi="IE";
	if (navi=="IE")			window.external.AddFavorite(url,titel);
	if (navi=="NS6")		window.sidebar.addPanel(titel, url, subtitel);
}

function go(x) {
	var piece=x.split("_");
	if (piece[0]=="load") x="load.php?d="+piece[1];
	else x=x+".php";
	if (piece[0]=="pms") x="userdetails2.php?showsite=pms";
	self.location.href = x;
	window.status=x;
}

function picpop(projekt,picid)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open('http://extern.ageweco.de/cmssender/showpic.php?projekt="+projekt+"&picid="+picid+"', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=true,menubar=0,resizable=1,width=900,height=675,left = 62,top = 46.5');");
}

// POPup starten / normal
function popUp(url)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=true,menubar=0,resizable=1,width=900,height=675,left = 62,top = 46.5');");
}

function popUp(url,width,height)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=true,menubar=0,resizable=0,width=400,height=600,left = 62,top = 46.5');");
}

function popUp2(URL,$mode)
{
	day = new Date();
	id = day.getTime();
	if ($mode==0) eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=true,menubar=0,resizable=1,width=900,height=675,left = 62,top = 46.5');");
	if ($mode==1) eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=true,menubar=0,resizable=1,width=300,height=100,left = 500,top = 300');");

}

// Layer verstecken und anzeigen
function turnOff(dname) { 
	document.getElementById(dname).style.display = 'none'; 
} 

function turnOn(dname) { 
	document.getElementById(dname).style.display = 'block'; 
} 


// ToolTippText /////////////////////////
/*
var wmtt = null;

document.onmousemove = updateWMTT;

function updateWMTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (wmtt != null) {
		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top 	= (y + 20) + "px";
	}
}*/

function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block";
}

function hideWMTT() {
	wmtt.style.display = "none";
}
//////////////////////////////////////////


// Peedy
var Peedy;

function LoadAgent(CharID, CharACS) {
  LoadReq = MSAgent.Characters.Load(CharID, CharACS);
  return(true);
  }

function showCharacter(text) {
  MSAgent.Connected = true;
//  AgentLoaded = MSAgent.Characters.Load("Peedy", "http://agent.microsoft.com/agent2/chars/Peedy/Peedy.acf");
  AgentLoaded = LoadAgent("Peedy", "http://agent.microsoft.com/agent2/chars/peedy/peedy.acf");
  Peedy = MSAgent.Characters.Character("Peedy");
  Peedy.LanguageId = '&H0407';
  Peedy.Get("state", "Showing, Speaking");
  Peedy.Get("animation", "Anncounce");
  Peedy.MoveTo(200, 300);
  Peedy.Show();
  Peedy.Play("Anncounce");
  Peedy.Speak(text);
  }

function hideCharacter() {
  Peedy.Get("animation", "Greet");  Peedy.Play("Greet");
  Peedy.Get("state", "Hiding");
  Peedy.Hide();
}
