function popupWindow(Href, Target, Width, Height) {
	window.open(Href, Target, "width=" + Width + ",height=" + Height + ",left=" + (screen.width - Width) / 2 + ",top=" + (screen.height - Height) / 2 + ",resizable=yes,scrollbars=yes");
}

function changeSearch() {
	if ($("#searchfield")) {
		var input_text = $("#searchfield").attr("title");
		$("#searchfield").val(input_text);
		$("#searchfield").attr("title", "");

		$("#searchfield").blur(function() {
			if ($(this).val() == "") {
				$(this).val(input_text);
				$(this).attr("title", "");
			}
		});
		$("#searchfield").focus(function() {
			if ($(this).val() == input_text) {
				$(this).val("");
				$(this).attr("title", input_text);
			}
		});
	}
}

function chooseForm() {
	$("#marketline option:selected").each(function() {
		if ($(this).val() == "m1") {
			$("#eaukcio").css("display", "block");
			$("#iszr").css("display", "none");
			$("#username").focus();
		} else {
			$("#eaukcio").css("display", "none");
			$("#iszr").css("display", "block");
			$("#login").focus();
		}
	});
}


function showNavbar() {
	var ssoCN = getSSOCookie('SSO-CommonName');
	var name = ssoCN + ' (' + getSSOCookie('SSO-CompanyName') + ')';
	var lastLogin = ssoDateFormat(getSSOCookie('SSO-LastLogin'));
	// var context = 'http://www.t-systems.hu/mytsystems';
	var context = '/mytsystems';
	var params = {
		ssoCommonName: name,
		ssoLastLogin: lastLogin,
		contextPath: context
	};
	var navCode = (ssoCN == null || ssoCN == '') ? LoginStripeControl.showOffline(params) : LoginStripeControl.show(params);
	$("#header").append(navCode);
}


$(document).ready(function() {

	showNavbar();
	changeSearch();
	
	if ($(".anythingSlider").length != 0) {
			$(".anythingSlider").anythingSlider({
			easing: "easeInOutExpo",
			autoPlay: true,
			delay: 5000,
			startStopped: false,
			animationTime: 500,
			hashTags: true,
			buildNavigation: true,
			pauseOnHover: true
		});
	}

});
