function PopupWindow(url,width,height,windowName)
{
	_PopupWindow(url,width,height,150,windowName);
}

function popup(url,width,height,windowName)
{
	_PopupWindow(url, 510, height,150,windowName);
}

function _PopupWindow(url,width,height,top,windowName)
{
	var center_x = (screen.width - width)/2;
	var center_y = (screen.height - height)/2;	
//    var num = Math.round(Math.random()*10000000);
//    var str = new String(num);
    var win = window.open(url,windowName,"toolbar=no,location=no,directories=no,"+
      "status=no,menubar=no,scrollbars=yes,resizable=no,"+
      "copyhistory=no,left="+center_x+",top="+center_y+",width="+width+",height="+height);
}
var rollOvers = new Array();
function imgRollOver(src,id,width,height)
{
    var i = src.indexOf(".",src.length-5);
    var srcOver;

	if (src.indexOf("_over")!=-1) srcOver=src;
	 else srcOver = src.substr(0,i) + "_over" + src.substr(i);

    var s = '<img src="' + src + '"'
        + ' align="absmiddle"' 
        + ' border="0" vspace="0" align="absmiddle" hspace="0" style="margin: 0; padding: 0;"'
        + ' onMouseOver="this.src=\'' + srcOver + '\';"'
        + ' onMouseOut="this.src=\'' + src + '\'"';

    if (width)
    {
        s += ' width="' + width + '"';
    }

    if (height)
    {
        s += ' height="' + height + '"';
    }

    if (id)
    {
        s+= ' id="' + id + '"';
    }

    s += '>';


    rollOvers[rollOvers.length] = new Image();
    rollOvers[rollOvers.length-1].src = srcOver;
    rollOvers[rollOvers.length-1].src2 = src;
    rollOvers[rollOvers.length-1].id = id;

    document.write(s);
}

function imgOverById(id,src)
{
    if (!src)
    {
        var i;
        for (i=0; i<rollOvers.length; i++)
        {
            if (rollOvers[i].id == id)
            {
                src = rollOvers[i].src;
            }
        }
    }

    var img = document.getElementById(id);
    if (img)
    {
        img.src = src;
    }
}


function getPageElement(id)
{
//"NN4";
    if(document.layers)
    {
		return document.layers[id];
    }
//"ie"    
    if(document.all)
    {
		return document.all[id];
    }
//"NN6";    
    if(!document.all && document.getElementById)
    {
		return document.getElementById(id);
    }
    
    return false;
}

