function getFormObject(objectName){return document.forms[objectName];};
function getHTMLObject(objectName){return document.getElementById(objectName);};
function hideItem(theItem){getHTMLObject(theItem).style.display	= "none";};
function showItem(theItem){getHTMLObject(theItem).style.display	= "block";};
function toggleShowItem(theItem){
	if(getHTMLObject(theItem).style.display	== "block"){
		getHTMLObject(theItem).style.display	= "none";
	}else{
		getHTMLObject(theItem).style.display	= "block";	
	}
};
function setBookmark(url,title){
	if(document.all){
		window.external.AddFavorite(url, title);
	}
	else if(window.sidebar){
		window.sidebar.addPanel(title, url, "");
	}
	else if(window.print && window.opera){
		var bmLink = document.createElement('a');
		bmLink.setAttribute('href',url);
		bmLink.setAttribute('title',title);
		bmLink.setAttribute('rel','sidebar');
		bmLink.click();
	} 
	else{
		if(editionLCID==1053){
			alert("Vi saknar tyvärr direktlänk för att lägga till bokmärket i den webbläsare du använder.");	
		}else{
			alert("Unfortunatly we were not able to add the bookmark directly to the browser you are using.");	
		}
	}
}
function removeGenericConfirm(theURL,theMessage){
	if(confirm(theMessage)){
		document.location=theURL;
	}
}
function ajaxRenewSession(){
	if($(".ajaxRenewLoginSession").is('*')){
		var theKey		= $(".ajaxRenewLoginSession > .key").text();
		var theRandom	= $(".ajaxRenewLoginSession > .rnd").text();
		var theSalt		= $(".ajaxRenewLoginSession > .salt").text();
		var theDate		= $(".ajaxRenewLoginSession > .dte").text();
	   $(".ajaxRenewLoginSession").load("/core/coreSrc/ajax/renew-session.asp",{randomInt : theRandom, keyStr : theKey, saltInt : theSalt, timeDate: theDate}, function(){});
	   setTimeout('ajaxRenewSession()',120000);
	}
}
function hideSystemMessage(){
	if($("div.systemMessageBox").is('*')){
	   $("div.systemMessageBox").fadeOut('slow');
	}
}
function clockSystemMessage2010(){
	var delayBox = $(".system-message-container").find(".delay");
	var newDelay = Math.floor(delayBox.html())-1;
	
	var doCount	 = !$(".pause-delay").is("*");
	if(newDelay > 0 && doCount){
		delayBox.html(newDelay);
		setTimeout('clockSystemMessage2010()',1000);
	}else{
		if(doCount){
			$(".system-message-container").fadeOut("slow");	
		}else{

		}
	}
}
function userAutoCompleteFill(tempName,tempId,destinationField,valueField){
	$("input#"+destinationField).val(tempId);
	$("input#"+valueField).val(tempName);
	$("div#autoComplete"+destinationField).slideUp("slow");
}
