/*  Mirwal JavaScript edit
 *  http://www.mirwal.de/
 *
 *--------------------------------------------------------------------------*/
 	
    $(document).ready(function(){ //cookie für die sprache setzen █ START █
		var sprache = document.cookie;
		if (!sprache){
//		if (navigator.language("de") > -1) {  // nur weil der IExplorer als einzieger mal wieder nicht mitspielt kann ich nicht mit dieser abfrage arbeiten ...
//				document.cookie = "de";      
//		} else  {
  			document.cookie = "en";
//		}
		}; // cookie für die sprache setzen █ ENDE █
		


		

	// ####################
	// # mwbutton # start # wichtiger interface der action 
	// ####################
	$("div:first").before('<p id="mwinfo" />');
	$("#mwaction").css({position: "absolute",	height: "15px"}); 
	
	
    $( "#info" ).draggable({ opacity: 0.35 , cursor: 'crosshair'  });
	
			$("#mwbutton").mouseover(function(){
			
	//	document.mwbutton.src = "images/icon/Mirwal-Button.over.jpg";
			
			
			$("#mwinfo").css({position: "absolute"});
				
			$(this).fadeTo(1000, 1);
			$("#mwinfo").css({opacity: "0.5", position: "absolute", color: "#f59",  zIndex: "5001", borderTop: "1px", borderLeft: "1px", borderBottom: "0px", borderRight: "0px",
												borderColor: "#A8BBFF", borderStyle: "solid", display: "block", padding: "2px 2px", minHeight: "100px", maxWidth: "300px", fontSize: "6px"
				});
			});	
		
			
			$("#mwbutton").mouseout(function(){
				$(this).stop();
				//$(this).css({opacity: "0.0"});
				$(this).fadeTo(1000, 1);});	
			
			$("#mwbutton").click(function(event){event.preventDefault();}); //verhindert link	
						
 		
			
	// ########### mousemove start
 		
					
			$("#mwaction").mousemove(function(event){		
			$("#mwinfo").stop();	
			$("#mwinfo").animate({
				left:  -200 + event.pageX + "px",
				top: event.pageY - 200 + "px"
				},50);			
			$("#mwinfo").html("<p> X1: " + event.pageX + " Y1: " + event.pageY + " x: " + event.screenX + " y: " + event.screenY + " tS: " + event.timeStamp +
										"<br /> title: " + document.title +
										"<br /> characterSet: " + document.characterSet + " location.href: " + location.href +
										"<br /> links: " + document.links.length +
										"<br /> innerHeight: " + window.innerHeight + " innerWidth: " + window.innerWidth +
										"<br /> availHeight: " + screen.availHeight + " availWidth: " + screen.availWidth +
										"<br /> info:  " + $("body").children().length + " abc: " + event.relatedTarget +
										"<br /> left:  " + $("#mwbutton").position().left +
										"<br /> top:   " + $("#mwbutton").position().top + "</p>" +
										"<hr /><br /><p>█▀▄▀█ █ █▀ █▄▀▄█ █▀█ █▄</p>"
			);
			
			$("#mwaction a img").css({cursor: "crosshair"});
			$("#mwaction").css({width: "80px"});
			
				
			
				
				
			}); 
			
			//############ mouseout start			
			$("#mwaction").mouseout(function(){
	//			document.mwbutton.src = "images/icon/Mirwal-Button.jpg";
				$("#mwinfo").stop();
				$("#mwinfo").animate({
						left:  0 + "px",
						opacity: "1"
					},500).animate({
						color: "#fff"
					},100).animate({
						top: -200 + "px",
						opacity: "0"
					},500);
				
			});	
			
	
				
	// ###################
	// # mwbutton # ende #
	// ###################
		
		
		
		
		
	}); 
	

