function initAll() 
	{ // beginning of function
	
//You can simulate the document.all collection in Netscape 6 in a variety of ways. 
//For a page whose element structure does not change under script control, 
//you can instruct NN6 to create a document.all property through W3C DOM syntax. 
//The following function, which should execute immediately after the page loads, shows a compact implementation:

	document.all = (document.all) ? document.all : 
    ((document.getElementsByTagName("*").length > 0) ?
    document.getElementsByTagName("*") : null)

	//...
	//<BODY onLoad="initAll()">

//After this function runs, any IE4 or W3C DOM browser provides access to an element object through the document.all.elementID syntax.

	} // end of function

// instaitae global variables
	var browsertype;

function checkbrowser()
	{ // beginning of function


	if (document.getElementById) {//If the W3C DOM API is supported
	// do our DHTML using the the W3C DOM API
	browsertype = "W3C";
	}
	
	else if (document.all) {//If the IE4 DOM API is supported
	// do our DHTML using the the IE4 DOM API
	browsertype = "IE4";
	}
	
	else if (document.layers) {//If the Netscape 4 DOM API is supported
		// do our DHTML effect (as best as we can) using the the Netscape 4 DOM API
	browsertype = "NS4";
	}

	else {//Otherwise DHTML is NOT supported
	// so provide a static alternativ to DHMTL, if we can
	browsertype = "Old";
	}

	//alert(browsertype);
			
	} // end of function



function checkbrowser2()
	{ // beginning of function

	var W3C = (document.getElementById) ? 1 : 0; 
	var IE4 = (document.all) ? 1 : 0; 
	var NS4 = (document.layers) ? 1 : 0; 

	if (W3C) {
	alert('W3C');
	//document.getElementById(argTagName).innerHTML = "W3C";
	} 
	
	else if (IE4) { 
	alert('IE4');
	//document.all.item(argTagName).innerText = "IE4";
	} 
	
	else if (NS4) { 
	alert('NS4');
	// stab in the dark!
	//document.layers[argTagName].document.open();
	//document.layers[argTagName].document.write("NS4");
	//document.layers[argTagName].document.close();
	} 
	
	else { 
	alert("Don't recognize this browser");
	}

	} // end of function


function printbrowsertype()
	{ // beginning of function
	
	if (browsertype == "W3C") {
	document.write ('W3C');
	} 
	
	else if (browsertype == "IE4") { 
	document.write ('IE4');
	} 
	
	else if (browsertype == "NS4") { 
	document.write ('NS4');
	} 
	
	else { 
	document.write ("Don't recognize this browser");
	}

	} // end of function
	
function redirectNS4()
	{ // beginning of function
		
	if (browsertype == "NS4") { 
	//window.location="http://d800/ordning/ordning_new/customer_club/webbrowser.asp";
	window.location="webbrowser.asp";
	} 
	
	else { 
	}

	} // end of function




//var x = new getObj('layername');

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
  
  alert(x.obj.id)

}


function visaalert(strIncoming)
	{ // beginning of function
	// använd denna funktion att anropa för andra funktioner
	// för att testa värden
	
	alert(strIncoming);
	
	} // end of function



function checklogintype2()
	{ // beginning of function

	
	//works on the Mac (both Mac IE och Safari) and PC - Legacy DOM
	//works on the PC Netscape 4.79 ie Netscape 4 DOM
	var fieldLoginTypeIdlist = document.updatelogin.elements['LoginTypeId']; //OK


	//works on the Mac IE and PC - IE4 DOM
	//but not on the Mac Safari
	//and not the PC Netscape 4.79 ie Netscape 4 DOM
	//var fieldLoginTypeIdlist = document.all.LoginTypeId; //OK

	// works on the PC - W3C DOM
	// but NOT on the Mac 
	//and not the PC Netscape 4.79 ie Netscape 4 DOM
	//(dock just för dropdowns - för vanlig DOM access verkar det fungera!!) 
	//var fieldLoginTypeIdlist = document.getElementById("LoginTypeId");
    var vIndex = fieldLoginTypeIdlist.selectedIndex;
    var vValue = fieldLoginTypeIdlist.options[vIndex].value;
    var vText = fieldLoginTypeIdlist.options[vIndex].text;

	//visaalert(vValue);
	//return true;
	

	//works on the Mac
	//var thistag;
	//thistag = window.event.srcElement.tagName;
	//thistagIndex = window.event.srcElement.selectedIndex;
	//thistagValue = window.event.srcElement.options[thistagIndex].value;
	//thistagText = window.event.srcElement.options[thistagIndex].text;
	
	//alert(thistagIndex);
	//alert(thistagText);
	

	visaalert(vValue);

	} // end of function
	
function checklogintype()
	{ // beginning of function

	
	//works on the Mac (both Mac IE och Safari) and PC - Legacy DOM
	//works on the PC Netscape 4.79 ie Netscape 4 DOM
	var fieldLoginTypeIdlist = document.updatelogin.elements['LoginTypeId']; //OK


	//works on the Mac IE and PC - IE4 DOM
	//but not on the Mac Safari
	//and not the PC Netscape 4.79 ie Netscape 4 DOM
	//var fieldLoginTypeIdlist = document.all.LoginTypeId; //OK

	// works on the PC - W3C DOM
	// but NOT on the Mac 
	//and not the PC Netscape 4.79 ie Netscape 4 DOM
	//(dock just för dropdowns - för vanlig DOM access verkar det fungera!!) 
	//var fieldLoginTypeIdlist = document.getElementById("LoginTypeId");
    var vIndex = fieldLoginTypeIdlist.selectedIndex;
    var vValue = fieldLoginTypeIdlist.options[vIndex].value;
    var vText = fieldLoginTypeIdlist.options[vIndex].text;

	//visaalert(vValue);
	//return true;
	

	//works on the Mac
	//var thistag;
	//thistag = window.event.srcElement.tagName;
	//thistagIndex = window.event.srcElement.selectedIndex;
	//thistagValue = window.event.srcElement.options[thistagIndex].value;
	//thistagText = window.event.srcElement.options[thistagIndex].text;
	
	//alert(thistagIndex);
	//alert(thistagText);
	

	//visaalert(vValue);



	switch(vValue)
	{ // beginning of switch dvs all cases
	
	case "1":
	// dvs personnr

	//document.updatelogin.elements['area_Personnr'].style.display = "";
	//document.updatelogin.elements['area_Email'].style.display = "none";
	//document.updatelogin.elements['area_Kortnummer'].style.display = "none";

	document.getElementById("area_Personnr").style.display = "";
	document.getElementById("area_Email").style.display = "none";
	document.getElementById("area_Kortnummer").style.display = "none";
	//visaalert('Du valde 1!');
	break; //case avslut
	
	case "2":
	// dvs email
	// disabled tsv
	document.getElementById("area_Personnr").style.display = "none";
	document.getElementById("area_Kortnummer").style.display = "none";
	document.getElementById("area_Email").style.display = "";
	//visaalert('Du valde 2!');
	break; //case avslut
	
	case "3":
	// dvs kortnummer
	document.getElementById("area_Personnr").style.display = "none";
	document.getElementById("area_Kortnummer").style.display = "";
	document.getElementById("area_Email").style.display = "none";
	//visaalert('Du valde 3!');
	break; //case avslut
	
	default: //dvs else sats
	document.getElementById("area_Personnr").style.display = "none";
	document.getElementById("area_Kortnummer").style.display = "none";
	document.getElementById("area_Email").style.display = "none";
	//visaalert('Du valde INTE 1 till 3!');
	break; //case avslut
	} // end of switch dvs all cases

	} // end of function


function checklogintype_ORIGINAL()
	{ // beginning of function

	
	//works on the Mac (both Mac IE och Safari) and PC - Legacy DOM
	var fieldLoginTypeIdlist = document.updatelogin.elements['LoginTypeId']; //OK


	//works on the Mac IE and PC, but not on the Mac Safari - IE4 DOM
	//var fieldLoginTypeIdlist = document.all.LoginTypeId; //OK

	// works on the PC but NOT on the Mac - W3C DOM 
	//(dock just för dropdowns - för vanlig DOM acces verkar det fungera!!) 
	//var fieldLoginTypeIdlist = document.getElementById("LoginTypeId");
    var vIndex = fieldLoginTypeIdlist.selectedIndex;
    var vValue = fieldLoginTypeIdlist.options[vIndex].value;
    var vText = fieldLoginTypeIdlist.options[vIndex].text;

	//visaalert(vValue);
	//return true;
	

	//works on the Mac
	//var thistag;
	//thistag = window.event.srcElement.tagName;
	//thistagIndex = window.event.srcElement.selectedIndex;
	//thistagValue = window.event.srcElement.options[thistagIndex].value;
	//thistagText = window.event.srcElement.options[thistagIndex].text;
	
	//alert(thistagIndex);
	//alert(thistagText);
	

	switch(vValue)
	{ // beginning of switch dvs all cases
	
	case "1":
	// dvs personnr
	document.getElementById("area_Personnr").style.visibility = "visible";
	document.getElementById("area_Email").style.visibility = "hidden";
	document.getElementById("area_Kortnummer").style.visibility = "hidden";
	//visaalert('Du valde 1!');
	break; //case avslut
	
	case "2":
	// dvs email
	// disabled tsv
	document.getElementById("area_Personnr").style.visibility = "hidden";
	//document.updatelogin.elements['area_Email'].style.visibility = "visible";
	document.getElementById("area_Email").style.visibility = "visible";
	document.getElementById("area_Kortnummer").style.visibility = "hidden";
	//visaalert('Du valde 2!');
	break; //case avslut
	
	case "3":
	// dvs kortnummer
	document.getElementById("area_Personnr").style.visibility = "hidden";
	document.getElementById("area_Email").style.visibility = "hidden";
	document.getElementById("area_Kortnummer").style.visibility = "visible";
	//area_Kortnummer.style.visibility = "visible";
	//visaalert('Du valde 3!');
	break; //case avslut
	
	default: //dvs else sats
	document.getElementById("area_Personnr").style.visibility = "hidden";
	document.getElementById("area_Email").style.visibility = "hidden";
	document.getElementById("area_Kortnummer").style.visibility = "hidden";
	//visaalert('Du valde INTE 1 till 3!');
	break; //case avslut
	} // end of switch dvs all cases

	} // end of function
