/*
 * Title: JavaScript Code
 *
 * Site: www.meinewindhunde.de
 *
 * Copyright (c) 2003-2009 by FeLIX Mueller
 */

var url = window.location.href.replace(/\.html/,"").replace(/\/$/,"/index");

/*
 * Print eMail address
 */
function EmailAddress() {
	n0 = "mailto";
	n1 = "miek";
	n2 = "eley";
	d1 = "meinew";
	d2 = "indhunde";
	d3 = "de";
	document.write("<a href=\"" + n0 + ":" + n1 + n2 + "@" + d1 + d2 + "." + d3 + "\">Dr. Margrit Miekeley</a>");
}

function EmailAddress2() {
	n0 = "mailto";
	n1 = "miek";
	n2 = "eley";
	d1 = "aol";
	d2 = "";
	d3 = "com";
	document.write("<a href=\"" + n0 + ":" + n1 + n2 + "@" + d1 + d2 + "." + d3 + "\">" + n1 + n2 + "@" + d1 + d2 + "." + d3 + "</a>");
}

function JumpToTop2() {
//	document.getElementById("text").scrollTop = 0;
	window.scrollTo(0, 0);
}

function JumpToTop() {
	var text = "nach oben";

	if (url.lastIndexOf("_en") > 0) {
		text = "back to top";
	}
		
//	if ( document.getElementById("text").scrollHeight > 600 ) {
//		document.write("<p class='back'><a href=\"javascript:JumpToTop2();\">" + text + "</a></p>");
//	}
}

function ShowSubmenu() {
	if (url.indexOf("gorazan") >= 0 || url.indexOf("ricky") >= 0 || url.indexOf("shari") >= 0 || url.indexOf("daoud") >= 0) {
		document.getElementById("sub1").style.display = "block";
	}
	return;

	var h = document.getElementById("text").scrollHeight;
	var h_ = document.body.clientHeight;
//	if (h_ > 670)
//	{
//		h = h_ -20-150-50-20;
		document.getElementsByTagName("body")[0].style.marginTop = 20;
//	}
	document.getElementById("text").style.height = h;
	document.getElementById("menu").style.height = h;
//	document.getElementById("menu").style.height = document.getElementById("text").scrollHeight + 50;

}

function SwitchToEnglish() {
	window.location = url + "_en.html";
}

function SwitchToGerman() {
	window.location = url.replace(/_en$/,"") + ".html";
}







var message="Thank you for visiting my site.";

function click(e) {
	alert("click");
	if (document.all) {
		if (event.button==2||event.button==3) {
			alert(message);
			return false;
		}
	}
	if (document.layers) {
		if (e.which == 3) {
			alert(message);
			return false;
		}
	}
}


if (document.layers) {
//	if (url.indexOf("daoud2") >= 0) { alert("hier"); } else
	document.captureEvents(Event.MOUSEDOWN);
}

//document.onmousedown=click;




function right(e) {
	var msg = "Nicht erlaubt.";
	if (navigator.appName == 'Netscape' && e.which == 3) {
		alert(msg);
		return false;
	}
	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
		alert(msg);
		return false;
	}
	else return true;
}

function trap() {
	if(document.images) {
		for(i=0;i<document.images.length;i++) {
			document.images[i].onmousedown = right;
			document.images[i].onmouseup = right;
		}
	}
}

//window.onload=trap;
//alert("done");


/*
 * Disable right mouse click
 */
document.onmousedown = checkRMClick;

if (document.layers) { 
	document.captureEvents(Event.MOUSEDOWN) 
}

function checkRMClick(evnt) {
	if (navigator.appName == "Netscape") {
		if (evnt.which != 1) { 
			alert("Nicht erlaubt"); 
			return false;
		}
	}
	else if (event.button != 1) { 
		alert("Nicht erlaubt");
		return false;
	}
}





function disableselect(e) {
	return false
}

function reEnable() {
	return true
}


if (url.indexOf("gaestebuch") <= 0) {
	//if IE4+
	document.onselectstart=new Function ("return false")
	
	
	//if NS6
	if (window.sidebar){
		document.onmousedown=disableselect
		document.onclick=reEnable
	}
}

