
/*
/***********************************************
* Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
* Modified here to exclude form tags properly, cross browser by jscheuer1
***********************************************/

//form tags to omit:
var omitformtags=["input", "textarea", "select"]


function right(e) {

	var msg = "The images displayed on this site are protected by international copyright law. For high resolution images and logo symbols refer to the Brand Management section.";

	if (navigator.appName == 'Netscape' && e.which == 3) {

		alert(msg);

		return false;

	}

	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {

	alert(msg);

	return false;

	}

	else return true;

	}


	function trap() 

	{

	if(document.images)

		{

		for(i=0;i<document.images.length;i++)

		{

		document.images[i].onmousedown = right;

		document.images[i].onmouseup = right;

		}

		}

	}

function noRightClick(e) {

	var msg = "The images displayed on this site are protected by international copyright law. For high resolution images and logo symbols refer to the Brand Management section.";

	if (navigator.appName == 'Netscape' && e.which == 3) {

		alert(msg);

	}

	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {

	alert(msg);

	}
		
}

function disableselect(e){
	for (i = 0; i < omitformtags.length; i++)
		if (omitformtags[i]==(e.target.tagName.toLowerCase()))
		return;
	return false
}

function reEnable(){
	return true
}

function noSelect(){
	if (typeof document.onselectstart!="undefined"){
		//Turn select start off on the document.
		document.onselectstart=new Function ("return false")
		if (document.getElementsByTagName){
			tags=document.getElementsByTagName('*')
			for (j = 0; j < tags.length; j++){
				if (tags[j].tagName.toLowerCase()=="img") {
					//alert(tags[j].tagName);
					tags[j].onmousedown=noRightClick;
				}
				for (i = 0; i < omitformtags.length; i++)
					//For those tags defined in the omitformtags array, allow onselectstart.
					if (tags[j].tagName.toLowerCase()==omitformtags[i]){
						tags[j].onselectstart=function(){
							document.onselectstart=new Function ('return true')
						}
						if (tags[j].onmouseup!==null){
							var mUp=tags[j].onmouseup.toString()
							mUp='document.onselectstart=new Function (\'return false\');\n'+mUp.substr(mUp.indexOf('{')+2,mUp.lastIndexOf('}')-mUp.indexOf('{')-3);
							tags[j].onmouseup=new Function(mUp);
						}
						else{
							tags[j].onmouseup=function(){
								document.onselectstart=new Function ('return false')
							}
						}
					}
				}
			}
		}
		else{
			document.onmousedown=disableselect;
			document.onmouseup=reEnable;
		}
	}
	
	//Left this function that is called in some page bodies to avoid script errors.
	function Trap() {}
	
	//Note: To disable this code for development purposes, comment out the following line of code:
	window.onload=noSelect;
	