
function check_checkbox(id)
{
	if(check_box = get_object(id))
	{
		if (!check_box.disabled)
		{
			check_box.checked = !check_box.checked;
			if (check_box.onclick)
			{
				check_box.onclick();
			}
		}
	}
}

function get_object(name)
{
	if (document.getElementById)
	{
		return document.getElementById(name);
 	}
 	else if (document.all)
	{
  		return document.all[name];
 	}
 	else if (document.layers)
	{
  		return document.layers[name];
	}
	return false;
}

function goto()
{
if ((window.opener) && (window.opener.document))
  sel = window.opener.document.selection.createRange();
else
  sel = document.selection.createRange();

window.opener.document.focus();
}

function openwin(link, name, x, y) {
  editWin = window.open(link, name ,'width='+x+',height='+y+',toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=0,copyhistory=0,screenX=100,screenY=50,left=220,top=200');
  editWin.focus();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ 
    d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){
   	document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ColourRoll(src, colour) { src.style.backgroundColor=colour;}

function show(id) {
	var yOffset = 17;
	if (document.getElementById) {
		var x=0;
		var y=0;
		var o = document.getElementById('P' + id);
		x = o.offsetLeft;
	    tempElementti = o.offsetParent;
	    while (tempElementti != null) {
        	x += tempElementti.offsetLeft;
	        tempElementti = tempElementti.offsetParent;
	    } 	    
	    y = o.offsetTop;
	    tempElementti = o.offsetParent;
	    while (tempElementti != null) {
        	y += tempElementti.offsetTop;
	        tempElementti = tempElementti.offsetParent;
		}
	    elementti=document.getElementById('C' + id); 
		elementti.style.visibility="visible";
		elementti.style.left=(x-5);
		elementti.style.top=(y+yOffset);
	}
	else if (document.all) {	
		var x=0;
		var y=0;
		var o = document.all('P' + id);
		x = o.offsetLeft;
	    tempElementti = o.offsetParent;
	    while (tempElementti != null) {
        	x += tempElementti.offsetLeft;
	        tempElementti = tempElementti.offsetParent;
	    }    
	    y = o.offsetTop;
	    tempElementti = o.offsetParent;
	    while (tempElementti != null) {
        	y += tempElementti.offsetTop;
	        tempElementti = tempElementti.offsetParent;
		}		
		document.all('C' + id).style.visibility="visible";
		document.all('C' + id).style.left=x;
		document.all('C' + id).style.top=(y+yOffset);
	}
		
	else if (document.layers) {
		var x=0;
		var y=0;
		var xl=0;
		x = document.anchors['P' + id].x;
		y = document.anchors['P' + id].y;
		document.layers['C' + id].visibility="show";
		document.layers['C' + id].left=x;
		document.layers['C' + id].top=(y+yOffset);
	}
}
	

function hide(id) {
	if (document.getElementById) {
		elementti=document.getElementById("C" + id); 
		elementti.style.visibility="hidden";
	}	
	if (document.all) {
		document.all("C" + id).style.visibility="hidden";
	}
	if (document.layers){
		document.layers["C" + id].visibility="hide";
	}
}