function doWebSearch(id1,id2,id3,id4)
{
	var arg1 = document.getElementById(id1).value;
	var arg2 = document.getElementById(id2).value;	
	var arg3 = document.getElementById(id3).value;	
	var arg4 = document.getElementById(id4).value;	

	if (arg1.length > 0) 
	{
		var url1 = 'http://www.google.com/search?q=' + escape(arg1);
		window.open(url1);
	}
	else if (arg2.length > 0) 
	{
		var url2 = 'http://search.msn.no/results.aspx?FORM=MSNH&CP=1252&q=' + escape(arg2);
		window.open(url2);	
	}
	else if (arg3.length > 0) 
	{
		var url3 = 'http://no.search.yahoo.com/search?fr=fp-tab-web-t-&ei=ISO-8859-1&p=' + escape(arg3);
		window.open(url3);	
	}
	else if (arg4.length > 0) 
	{
		var url4 = 'http://search.kvasir.no/query?q=' + escape(arg4) + '&what=web-no';
		window.open(url4);	
	}		
	else
	{
		alert("Ingen tekst er valgt!")
	}	
}


function hideshow(show_id, hide_id)
{
	var content_show = document.getElementById(show_id).style;
	var content_hide = document.getElementById(hide_id).style;
	
	content_show.display = 'none';
	//content_hide.display = 'block';			
}			
			
			
			
function collapse(id)
{
				//alert(id);
				var content = document.getElementById(id).style;
				if(content.display == 'none')
				{// Expand
					document.getElementById(id + '_img').removeAttribute('src');
					document.getElementById(id + '_img').setAttribute('src', 'arch/_img/9063667.jpg');
					content.display = 'block';
				}
				else
				{//Collapse
					document.getElementById(id + '_img').removeAttribute('src');
					document.getElementById(id + '_img').setAttribute('src', 'arch/_img/9063663.jpg');
					content.display = 'none';
				}
			}



//<!--

var win=null;
function NewWindow(mypage,w,h,bScroll,bMenu,bResize, sWinName){
	var LeftPosition, TopPosition, settings
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=((screen.height)?(screen.height-h)/2:100)-100;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+bScroll+',location='+bMenu+',directories='+bMenu+',status='+bMenu+',menubar='+bMenu+',toolbar='+bMenu+',resizable='+bResize;
	
	if(win)
	{
		win.close();
		win=window.open(mypage,sWinName,settings);
		win.focus();
	}
	else
	{
		win=window.open(mypage,sWinName,settings);
//		win.resizeTo(w,h); 
		win.focus();
	}				
}

function checkSubmit(e, jsCode)
{
	var charCode = (navigator.appName == "Netscape")? e.which : e.keyCode;
	if(charCode == 13)
	{
		e.keyCode = 9;
		eval(jsCode);
	}
}

function TieButton(btn){
    if (document.all)
    {
		var charCode = (navigator.appName == "Netscape")? event.which : event.keyCode;
    
		if (charCode == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
    }
}


function doSearchForm(document_id, textbox)
{
	document.location.href = "?did=" + document_id + "&" +  textbox.name + "=" + textbox.value;
}

function doAdvancedSearchForm(document_id, textbox)
{
	document.location.href = "?did=" + document_id + "&" +  textbox.name + "=AdvancedINIT"
}






