﻿// JavaScript Document

// Home funktion der sættes på logoet
function GoHome() {
	strDomain = location.href;
	strDomain = strDomain.slice(0,strDomain.indexOf("/",7));
	location.href = strDomain;
}

function InputFocus(obj,txt) {
	if(obj.value==txt){
		obj.value = "";
	}
}
function InputBlur(obj,txt) {
	if(obj.value==''){
		obj.value = txt;
	}
}

function ChangeInputBG(obj) {
	if(obj.value==''){
		obj.style.backgroundImage='url(/Files/System/LeMu/Graphic/LMe-PartnerPasswordBackground.gif)';
	}
}

function PrintPage(url){
	if(url.indexOf('?')>=0){
		charType = "&";	
	}
	else
	{
		charType = "?";
	}
	window.open(location.href+charType+'Printerfriendly=2')
}
function PrintPageLmg(url){
	if(url.indexOf('?')>=0){
		charType = "&";	
	}
	else
	{
		charType = "?";
	}
	window.open(location.href+charType+'Printerfriendly=3')
}
/*var SelectedMenuItem = null;
function initFoldOut() {
	var accordion = new Accordion('h6.atStart1', 'div.atStart1', {alwaysHide: true,	opacity: false,	show: 0}, $('accordion1'));
	
	var arrMenuItem = document.getElementById('accordion1').getElementsByTagName('div');
	for(x=0;x<arrMenuItem.length;x++){
		if(arrMenuItem[x].className == "FoldOutMenuItem"){
			arrMenuItem[x].style.backgroundImage = "url(/Files/System/LeMu/Graphic/FoldOutMenuFrontpageItemOn.gif)";
			SelectedMenuItem = arrMenuItem[x];
			break;
		}
	}
}

function ChangeState(obj) {
	SelectedMenuItem.style.backgroundImage = "url(/Files/System/LeMu/Graphic/FoldOutMenuFrontpageItemOff.gif)";
	obj.style.backgroundImage = "url(/Files/System/LeMu/Graphic/FoldOutMenuFrontpageItemOn.gif)";
	SelectedMenuItem = obj;
}*/

function NZSearchShowHide() {
	var objButton = document.getElementById('NZSearchButton');
	var objField = document.getElementById('NZSearch');
	//objField.style.left = document.getElementById('Wrapper').offsetLeft + "px";
	//alert(document.getElementById('MainMenu').offsetLeft);
	
	if(objButton.style.display == "none")
	{
		objButton.style.display = "block";
		objField.style.display = "block";
		document.getElementById('txtNZQ').focus();
	}
	else
	{
		objButton.style.display = "none";
		objField.style.display = "none";
		document.getElementById('txtNZQ').blur();
	}
}

// Forhandlersøg - Kontaktsiden
function FSChangeType(strValue){
//	$("#storelocator").onChangeType(strValue);	// VIRKER IKKE


	if(strValue == "null"){
		strValue = "";
	}
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	var tl = (ie) ? window['customStoreLocatorID'] : document['customStoreLocatorID'];
	tl.onChangeType(strValue);





}