﻿var viewportwidth;
var viewportheight;

document.write('<script type="text/javascript" src="resources/js/stu.js"></script>')

function getViewport() {
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerWidth,
		viewportheight = window.innerHeight
	}

	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		viewportwidth = document.documentElement.clientWidth,
		viewportheight = document.documentElement.clientHeight
	}

	// older versions of IE
	else {
		viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
		viewportheight = document.getElementsByTagName('body')[0].clientHeight
	}
}

// Einblendung des Logo-Textes bei MouseOver über das Logo
$(document).ready(function() {
	//$("#logotext").css("opacity", 0); 	// Logo-Text unsichtbar machen
	window.setTimeout("logoSlideUp()", 5000);
	clearTimeout("logoSlideUp()");
	$("#logo_start").hover(function() {
		$("#logotext_start").animate({
			top: '-19'
		}, 1000, function() {
			// Animation complete.
		});
	}, function() {
		$("#logotext_start").animate({
			top: '-130'
		}, 1000, function() {
			// Animation complete.
		});
	});
});

$(window).resize(function() {
	//logoPosition();
});


function logoPosition() {
	$("#logocontainer").animate({
		top: '0'
	}, 1000, function() {
		// Animation complete.
	});
	getViewport();
	//$("#logocontainer").css("left", ((viewportwidth - 1140) / 2) + 150);
}

function logoSlideUp() {
	$("#logo_start").animate({
		top: '-5'
	}, 2000, function() {
		// Animation complete.
	});
	$("#logotext_start").animate({
		top: '-130'
	}, 1000, function() {
		// Animation complete.
	});
	//getViewport();
	//$("#logocontainer").css("left", ((viewportwidth - 1140) / 2) + 150);
}

// Weiter beispiele:
/*$(document).ready(function() {
	$(".klasse").fadeTo("slow", 0.3); // This sets the opacity of the thumbs to fade down to 30% when the page loads
	$(".klasse").hover(function() {
		$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
	}, function() {
		$(this).fadeTo("slow", 0.3); // This should set the opacity back to 30% on mouseout
	});
});

$(document).ready(function() {
	$("#div p").fadeTo("slow", 0.3); // This sets the opacity of the thumbs to fade down to 30% when the page loads
	$("#div p").hover(function() {
		$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
	}, function() {
		$(this).fadeTo("slow", 0.3); // This should set the opacity back to 30% on mouseout
	});
});*/

