//ERROR = NO ERROR
function ignoreErrors() {
return true;
}
window.onerror = ignoreErrors;

//NAVIGATION IMG CHANGE
function over(pic_name)
{
 document.getElementById(pic_name).src = "img/bttn/"+pic_name+"_over.png";
}
function out(pic_name)
{
 document.getElementById(pic_name).src = "img/bttn/"+pic_name+".png";
}

//TITLE BAR TXT
function txtChange(xid)
{
 document.getElementById("title_bar_txt").innerHTML = xid;
}
function txtNormal()
{
	document.getElementById("title_bar_txt").innerHTML = "MASTERCLASS-WEBDESIGN.DE Informations Panel";
 document.all.title_bar_txt.innerHTML = "MASTERCLASS-WEBDESIGN.DE Information";
}
//NAVIGATION  wtf
function NavOver()
{
 //document.getElementById("nav_block").src = "img/box/nav_block2.png";
	//document.getElementById('nav_block').style.backgroundImage.src = "img/box/nav_block2.png";
	document.getElementById('nav_block').style.backgroundImage = "url(img/box/nav_block2.png)";
//	document.all.nav_block.style.backgroundImage = url(img/box/nav_block2.png);	
//	document.getElementsByTagName("p")[i].style.backgroundColor = "#FF9933";
//	document.all.nav_block.src = "img/box/nav_block2.png";
}
function NavOut()
{
 document.getElementById('nav_block').style.backgroundImage = "url(img/box/nav_block.png)";
	txtNormal();
 document.all.nav_block.style.backgroundImage = "url(img/box/nav_block.png)";
	//document.all.nav_block.style.backgroundImage.src = "img/box/nav_block.png";	
}
//WINDOW OPEN
function openWin(link1,name1) {
  win1 = window.open(link1, name1, "width=300,height=450,left=100,top=200");
  win1.focus();
}

//TOOLTIP
wmtt = null;

function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block"
}
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 + 10) + "px";
		wmtt.style.top 	= (y + 15) + "px";
	}
}
function hideWMTT() {
	wmtt.style.display = "none";
}
//TOOLTIP EOF

//Externe Links kennzeichnen
var mydomain = document.location.host;
//alert('DOM: '+mydomain);
var extimagesrc = "img/icon/ext_link.gif";
var extimageoversrc = "img/icon/ext_link_over.gif";

function isExternLink(host) {
	if (host == "" || host == "www.spreadfirefox.com" || host == "www.masterclass.de" || host == "creativecommons.org") return false;
	var expr = new RegExp(mydomain, "i");
	if (expr.test(host)) return false;
	return true;
}

function init() {
	var alllinks = document.getElementsByTagName("a");

	for (var i = 0; i < alllinks.length; i++) {
		if (isExternLink(alllinks[i].host)) {
			var extimg = document.createElement("img");
			extimg.src = extimagesrc;
			extimg.width = 12;
			extimg.height = 12;
			extimg.title = "Externen Link in einem neuen Fenster öffnen.";
			if (!document.all) extimg.style.cursor = "pointer";
			extimg.longDesc = alllinks[i].href;
			extimg.onmouseover = function() {
				this.src = extimageoversrc;
			}
			extimg.onmouseout = function() {
				this.src = extimagesrc;
			}
			extimg.onclick = function() {
				window.open(this.longDesc);
			}
			alllinks[i].parentNode.insertBefore(extimg, alllinks[i]);
		}
	}
}
//Externe Links kennzeichnen EOF
