
//-protect.js-\\


function noway(go) 
{
	//var popup="Sorry, right-click is disabled.\n\nThis Site Copyright �2000"; 
	if ((document.all))
	{ 
		if (event.button == 2) 
		{ 
			//alert(popup); 
			return false; 
		} 
	} 
	else if (document.layers) 
	{ 
		if (go.which == 3) 
		{ 
			//alert(popup); 
			return false; 
		} 
	} 
}; 

var message="Information on this page is (c) GMP Scotland Ltd.  No unauthorised copying to another website or publication is permitted without prior permission.";
function NoRC(e)
{
  if (document.all)
  {
    if (event.button==2||event.button==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    if (e.button==2||e.button==3)
    {
      e.preventDefault();
      e.stopPropagation();
      alert(message);
      return false;
    }
  }
 
}

if (document.all) // for IE
{
  document.onmousedown=NoRC;
}
else // for FF
{
  document.onclick=NoRC;
}

if (document.layers) 
{ 
	document.captureEvents(Event.MOUSEDOWN); 
} 
//document.onmousedown = NoRC;

Event.observe(document, 'dom:loaded', function() { 
	var body = document.getElementsByTagName("body")[0];
	body.ondragstart=function(){return false;};
	body.onselectstart=function(){return false;};
 });


//- -- --\\


//-MetaDataValueControl.js-\\
// Client Functions for MetaDataValueControl and also NodeParameterValueControl.

var MetaDataValueControl = {
    restorePage: function()
    {
	    setTimeout('formDisable(false)', 300);
	    return true;
    },
    RadioButtonListDisable: function(id, disabled)
    {
	    var radUl = $(id);
	    if(radUl)
	    {
		    if(typeof(radUl.disabled) != 'undefined'){ radUl.disabled = disabled;}
		    var radValue1 = $(id + '_1');
		    var radValue2 = $(id + '_2');
		    var lblValue1 = radValue1.next(); //get_previoussibling(radValue1);
		    var lblValue2 = radValue2.next(); //get_previoussibling(radValue2);
		    if(typeof(radValue1.disabled) != 'undefined') radValue1.disabled = disabled;
		    if(typeof(radValue2.disabled) != 'undefined') radValue2.disabled = disabled;
		    if(typeof(lblValue1) != 'undefined') lblValue1.disabled = disabled;
		    if(typeof(lblValue2) != 'undefined') lblValue2.disabled = disabled;
	    }
    },
    AssetTextboxDisable: function(id, txtId, btnId, disabled)
    {
	    var tbl = $(id);
	    if(tbl)
	    {
		    if(typeof(tbl.disabled) != 'undefined'){ tbl.disabled = disabled;}
	    }
	    var txt = document.getElementById(txtId);
	    if(txt)
	    {
		    if(typeof(txt.disabled) != 'undefined'){ txt.disabled = disabled;}
	    }
	    setButtonState(btnId, null, !disabled)
    	
    },
    HtmlEditorDisable: function(id, disabled, fEditorInitFunction)
    {
	    var txtHtmlEditor = $(id);
	    if(txtHtmlEditor)
	    {
		    if(typeof(txtHtmlEditor.disabled) != 'undefined'){ txtHtmlEditor.disabled = disabled;}
		    if(disabled)
		    {
			    //tinyMCE.get(id).hide();
			    		    
			    tinyMCEext.setReadonly(id, true);
			    
		    }
		    else
		    {
			    //tinyMCE.get(id).show();
			    if ((fEditorInitFunction != '')&&(txtHtmlEditor.hasTinyMCEInit != true))
			    {
			        tinyMCEext.setReadonly(id, false);
			        txtHtmlEditor.style.display = '';			        
			        eval(fEditorInitFunction);
			        txtHtmlEditor.hasTinyMCEInit = true;
			        
			    }
			    else
			    {
			        tinyMCEext.setReadonly(id, false);
			    }
		    }
	    }
    },
    ListBoxDisable: function(id, disabled)
    {
        var listBox = $(id);
        if(listBox)
	    {
		    if(typeof(listBox.disabled) != 'undefined'){ listBox.disabled = disabled;}
	    }
    },
    CheckBoxListDisable: function(id, disabled)
    {
        //TODO: disable CheckBoxList.
    }
};	
	
	

//- -- --\\


