﻿// <TE Functions>

function avaaSivu() {
	if (document.Form1.slcTuote.selectedIndex > 0)
		window.location = document.Form1.slcTuote.options[document.Form1.slcTuote.selectedIndex].value;
		
	if (document.Form1.slcPalvelu.selectedIndex > 0)
		window.location= document.Form1.slcPalvelu.options[document.Form1.slcPalvelu.selectedIndex].value;
}

// </TE Functions>


function clearPersonalLogin (input) {
	//alert(input.name);
	/*
	alert('*' + input.value + '*');

	if (input.value == 'käyttäjätunnus') {
		alert('Arvo');
		input.value = '';
	} else {
		alert('Ei Arvoa');	
	}
	*/
	//if (input.Form1.EtusivuControl__ctl1_salasana.value=='salasana') input.Form1.EtusivuControl__ctl1_salasana.value = '';

	/*
	if (input.form.userid.value=='käyttäjätunnus') input.form.userid.value = '';
	if (input.form.password.value=='salasana') input.form.password.value = '';	
	*/
}


function resetPersonalLogin (input) {
	/***if (input.form.userid.value=='' && input.form.password.value=='') {
		input.form.userid.value = 'käyttäjätunnus';
		input.form.password.value = 'salasana';
	}***/
}


function showPersonalLinks() {
	if (document.getElementById) {
		document.getElementById('personalLinksList').style.display = "block";
		document.getElementById('personalLinksHide').style.display = "block";
		document.getElementById('personalLinksShow').style.display = "none";
		document.getElementById('personalLinks').className = "personalLinksShown";		
	}
}


function hidePersonalLinks() {
	if (document.getElementById) {
		document.getElementById('personalLinksList').style.display = "none";
		document.getElementById('personalLinksHide').style.display = "none";
		document.getElementById('personalLinksShow').style.display = "block";
		document.getElementById('personalLinks').className = "personalLinksHidden";		

	}
}

function showPromoToolsTabPrivate() {
	if (document.getElementById) {
		document.getElementById('promoToolsTabCompanies').style.display = "none";
		document.getElementById('promoToolsTabPrivate').style.display = "block";
	}
}

function showPromoToolsTabCompanies() {
	if (document.getElementById) {
		document.getElementById('promoToolsTabPrivate').style.display = "none";
		document.getElementById('promoToolsTabCompanies').style.display = "block";	
	}
}

function avaaLasku(input)
{

	window.open(input,'Polttonestelasku','toolbar=yes,titlebar=yes,menubar=yes,status=yes,location=yes,scrollbars=yes,resizable=yes,directories=yes,copyhistory=yes,width=600,height=400');
}

/*
function isCookieEnabled() {
	setCookie("NesteSelainTestausCookie", "toimii");
	var cookieValue = getCookie("NesteSelainTestausCookie");

	if (cookieValue == null || cookieValue == "") {
		alert("ei ole cookieta päällä");
	} else {
		alert("cookie on: " + cookieValue);
	}
}


function getCookie(NameOfCookie) {
	if (document.cookie.length > 0) {
		begin = document.cookie.indexOf(NameOfCookie+"=");
		if (begin != -1) { 
			begin += NameOfCookie.length+1;
			end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end));
		}
	}
	return null;
}


function setCookie(NameOfCookie, value) {
	var ExpireDate = new Date ();
	var expiredays = 90;
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}


function delCookie (NameOfCookie) {
	if (getCookie(NameOfCookie)) {
		document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}
*/
