function chgimg (id, src)
{
    obj = document.getElementById(id);
    if(obj != null) {
        obj.src = src;
    }
}

function sts (txt)
{
    window.status = txt;
}

function preload (src)
{
    image = new Image(); 
    image.src = src;
}

/*

var editing  = false;

if (document.getElementById && document.createElement)
{
	var butt = document.createElement('BUTTON');
	var buttext = document.createTextNode('Ready!');
	butt.appendChild(buttext);
	butt.onclick = saveEdit;
}

function catchIt(e)
{
    if (!e) newobj = window.event.srcElement;
	else newobj = e.target;
    
	if (!document.getElementById || !document.createElement) return;
	
    //alert(newobj.nodeName);
	while (newobj.nodeType != 1)
	{
		newobj = newobj.parentNode;
	}
	if (newobj.tagName == 'TEXTAREA') return;
	while (newobj.className != 'frontendEdit' && newobj.nodeName != 'HTML' && newobj != toolbox)
	{
		newobj = newobj.parentNode;
	}
    
    if (editing) {
        //alert('currently editing');
        if(newobj != obj && newobj != toolbox) {
            //alert(newobj.nodeName+" = "+obj.nodeName);
            saveEdit();
        } else {
            return;
        }
    }
    
    obj = newobj;
	if (obj.nodeName == 'HTML') return;
    if (obj.className != "frontendEdit") return;
    //alert(obj.className+"= frontendEdit");
	var x = obj.innerHTML;
	textobj = document.createElement('DIV');
    //alert(obj.parentNode.parentNode.parentNode.offsetTop + ', ' + obj.parentNode.parentNode.parentNode.parentNode.nodeName + ' , ');
    textobj.setAttribute("contentEditable", true);
    textobj.style.border = '1px solid #9e9e9e';
    obj.innerHTML = '';
    //obj.insertAdjacentElement("afterBegin", butt);
    obj.insertAdjacentElement("afterBegin", textobj);
    //alert(findPosX(textobj)+','+findPosY(textobj));
    
    toolbox.style.top = parseInt(findPosY(textobj))-29;
    toolbox.style.left = parseInt(findPosX(textobj));
    toolbox.style.visibility = 'visible';
    //alert(findPosX()+'.'+findPosY());
    textobj.innerHTML = x;
	textobj.focus();
	editing = true;
}

function catchMouseover(e) {
    if(editing) return;
	if (!document.getElementById || !document.createElement) return;
	if (!e) obj = window.event.srcElement;
	else obj = e.target;
    //alert(obj.nodeName);
	while (obj.nodeType != 1)
	{
		obj = obj.parentNode;
	}
	if (obj.tagName == 'TEXTAREA' || obj.tagName == 'A') return;
	while (obj.className != 'frontendEdit' && obj.nodeName != 'HTML')
	{
		obj = obj.parentNode;
	}
    border = obj.style.border;
    obj.style.border = '1px solid #000000';
    obj.onmouseout = function() {
        if(!editing) {
            obj.style.border = border;
        }
    }
}

function saveEdit()
{
    //alert(textobj.value);
    toolbox.style.visibility = 'hidden';
    obj.innerHTML = textobj.innerHTML;
	editing = false;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function init() {
    if(document.body) {
        toolbox = '<div id="frontendToolbox" style="visibility: hidden; position: absolute; background: #ffffff; border: 1px solid #D4D0C8; padding: 1px;">';
        toolbox += '    <img onclick="textobj.execCommand(\'Bold\', false);" class="btnNormal" src="admin/gfx/edit_toolbar/bold.gif" alt="Fed" border="0" onmouseover="this.className = \'btnHover\';" onmouseout="this.className = \'btnNormal\'">';
        toolbox += '    <img onclick="textobj.execCommand(\'Italic\', false);" class="btnNormal" src="admin/gfx/edit_toolbar/italic.gif" alt="Skæv" border="0" onmouseover="this.className = \'btnHover\';" onmouseout="this.className = \'btnNormal\'">';
        toolbox += '    <img onclick="textobj.execCommand(\'Underline\', false);" class="btnNormal" src="admin/gfx/edit_toolbar/under.gif" alt="Understreget" border="0" onmouseover="this.className = \'btnHover\';" onmouseout="this.className = \'btnNormal\'">';
        toolbox += '</div>';
        document.body.innerHTML = toolbox + document.body.innerHTML;
        toolbox = document.getElementById("frontendToolbox");
    } else {
        setTimeout("init()", 100);
    }
}

document.write('<link rel="stylesheet" href="/admin/default.css">');

document.onclick = catchIt;
document.onmouseover = catchMouseover;
init(); */

function doPopup (url, width, height) {
	day     = new Date();
    id      = day.getTime();
    bwidth  = window.screen.width;
    bheight = window.screen.height;
    fleft    = ((bwidth - width) / 2);
    ftop     = ((bheight - height) / 2);
	
   	eval("page" + id + " = window.open(url, \'" + id + "\', \'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=" + width + ",height=" + height + ",left = " + fleft + ",top = " + ftop + "\');");
   	eval("obj = page"+id+";");
		
    return obj;
}
