_uacct = "UA-2852614-2";
urchinTracker();

function popup(url, name, add) {
  F = window.open(url, name, add);
}

function closeme() {
	this.close();
}

function sendform(what)
{
	what.submit();
}

function back()
{
	history.back();
}

function toClipboard(what)
{
	window.clipboardData.setData('Text', what);
}

function frameloc(fid, url)
{
	parent.frames[fid].location.href = url;
}

function changeLocation(name, url)
{
	x = eval("top."+name);
	x.location.href = url;
}



var color_low = '';
var color_fix = '#FF8C8C';

var dummy_id = -1;
var dummy_color = -1;

var dummy1 = 0;
var dummy2 = 0;

function highlight(id, col)
{
	if (id != dummy_id)
	{
		dummy_color = document.getElementById(id).style.backgroundColor;
		color_low = document.getElementById(id).style.backgroundColor;
		document.getElementById(id).style.backgroundColor = col;
	}
}

function downlight(id)
{
	if (id != dummy_id)
	{
		document.getElementById(id).style.backgroundColor = dummy_color;
	}
}

function setFix(id)
{
	if (dummy_id > -1)
	{
		document.getElementById(dummy_id).style.backgroundColor = color_low;
	}

	document.getElementById(id).style.backgroundColor = color_fix;
	dummy_id = id;
}

function confirmLink(theLink, message)
{
    var is_confirmed = confirm(message);

	if (is_confirmed)
	{
        theLink.href += '&is_js_confirmed=TRUE';
    }

    return is_confirmed;
}

function toggle(element, status)
{
	x = eval(document.getElementById(element));

	if (!status)
	{
		if(x.style.display == 'none')
		{
			x.style.display = 'block';
		}
		else
		{
			x.style.display = 'none';
		}
	}
	else
	{
		x.style.display = status;
	}
}

function ZweiFrames(URI1,F1,URI2,F2) {
	  Frame1=eval("parent."+F1);
	  Frame2=eval("parent."+F2);
	  Frame1.location.href = URI1;
	  Frame2.location.href = URI2;
}

function ZweiFramesReload(F1, F2) {
	  Frame1=eval("parent."+F1);
	  Frame2=eval("parent."+F2);
	  Frame1.location.reload();
	  Frame2.location.reload();
}


function EinFrame(URI1,F1) {
	  Frame1=eval("parent."+F1);
	  Frame1.location.href = URI1;
}

function EinFrameReload(F1) {
	  Frame1=eval("parent."+F1);
	  Frame1.location.reload();
}

function sourroundSelection(tag) {

	theSelection = document.selection.createRange().text;

	if (!theSelection)
   	{
		return false;
   	}

   	if (document.selection.createRange().parentElement().tagName != 'TEXTAREA')
	{
		return false;
	}

	if(tag == 'b')
	{
		document.selection.createRange().text =  "<b>"+ theSelection + "</b>";
	}
	if(tag == 'u')
	{
		document.selection.createRange().text =  "<u>" + theSelection + "</u>";
	}

}

