/* Toogle text in search field functions
---------------------------------------------------------------- */

function focusField(f,txt){

	// Declare variable
	var field = document.getElementById(f.id);
	
	// Clean field, markup if text is not the same as original
	if(field.value==txt){
		field.value = '';
	}else{
		field.select();
	}

}

function blurField(f,txt){

	// Declare variable
	var field = document.getElementById(f.id);
	
	// Restore field if not text is original
	if(field.value==''){
		field.value = txt;
	}

}

/* Link function
---------------------------------------------------------------- */

function goToUrl(popup,url){

	// If popup is true, then open in popup, else open normal
	if(url){
		if(popup){
			window.open(url);
		}else{
			location.href = url;
		}
	}

}

/* Highslide extra
---------------------------------------------------------------- */

function openPopup(f){
	document.getElementById('dark').style.display = 'block';
	document.getElementById('popup').onclick();
}

function closePopup(f){
	document.getElementById('dark').style.display = 'none';
}

function openPage(f,p){
	if(f){
		if(document.getElementById('dark').style.display=='none' || document.getElementById('dark').style.display==''){
			openPopup();
		}
		ajaxpage(f,'ajx');
	}
}
