/* 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;
		}
	}

}
