// När man trycker på mer info visas denna text
//
function visa_info(domain, whois)
{
	open ('merinfo.asp?domain=' + domain + '&whois=' + whois,'','toolbar=no,directories=no,menubar=no,scrollbars=yes,width=450,height=400,resizable=yes');
}

function set_item_status(strItem, status) 
{
	var changeStr;
	var theObj;
	var dispStr;
							
	if (document.getElementById)
	{
		changeStr = "document.getElementById('" + strItem + "')";
		theObj = eval(changeStr);
		if (theObj)
		{
			 theObj.style.display = status;
		}
	}
					
	else if (document.all) 
	{
		changeStr = "document.all['"+ strItem + "']";
		theObj = eval(changeStr);
		if (theObj)
		{
			 theObj.style.display = status;
		}	
	}
			
}

function show_item(strItem) 
{
	set_item_status(strItem, 'block');
}

function hide_item(strItem) 
{
	set_item_status(strItem, 'none');
}

function toggle_item(item, bShow)
{
	if (bShow)
		show_item(item);
	else
		hide_item(item);
}

function onChangeCompany(bCompany)
{
	toggle_item("FtgNamn", bCompany);	toggle_item("PersonNamn", !bCompany);
	toggle_item("OrgNr", bCompany);		toggle_item("PersonNr", !bCompany);
	toggle_item("VATNr", bCompany);
	toggle_item("AdminName", bCompany);
}

function onRadioCompany()
{
	toggle_item("Firma", true);
	toggle_item("PrivatPerson", false);
	toggle_item("KontaktID", false);
}

function onRadioPerson()
{
	toggle_item("Firma", false);
	toggle_item("PrivatPerson", true);
	toggle_item("KontaktID", false);
}

function onRadioKontaktID()
{
	toggle_item("Firma", false);
	toggle_item("PrivatPerson", false);
	toggle_item("KontaktID", true);
}

function onRadioResultCompany()
{
	toggle_item("Resultat_0", false);
	toggle_item("Resultat_1", true);
}

function onRadioResultPerson()
{
	toggle_item("Resultat_0", true);
	toggle_item("Resultat_1", false);
}

function onRadioContactCompany(bNewContact)
{
	toggle_item("NyKontakt", bNewContact==0);	
	toggle_item("BefKontakt", bNewContact==1);
}

function onLoadPage()
{
	if (document.Bekrafta_Anvandare_Formular.companyContact[0].checked)
		onRadioContactCompany(0);
	else if (document.Bekrafta_Anvandare_Formular.companyContact[1].checked)
		onRadioContactCompany(1);
	else if (document.Bekrafta_Anvandare_Formular.companyContact[2].checked)
		onRadioContactCompany(2);
}


function onChangeAvi(bShowAvi)
{
	toggle_item("showAvi", !bShowAvi);
	toggle_item("Avisering", bShowAvi);
}


