//All functions in this script is copyrighted
//If you just downloaded this file to take a quick look, deleted it. Now.
//Copyright; Jo-Ba AS

function opentexteditor(id){
	winid = window.open('/admin/translate/?id='+id, 'edittext');
	winid.focus();
}

function openimageeditor(id){
	winid = window.open('/admin/images/?id='+id, 'editimage');
	winid.focus();
}

function openlinkeditor(id){
	winid = window.open('/admin/link/?id='+id, 'editimage');
	winid.focus();
}

function confirmcart(id){
	button = document.getElementById(id);
	button.innerHTML = '<img src="images/loading_wait.gif">';
	document.theform.submit();
}

function nl2br (str, is_xhtml) {   
	var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';    
	breakTag = '<br />';
	return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
}

