	/*
		show error and clear error are used for input forms where the input is not valid.
	*/
	function showError (id) {
		if (!document.getElementById){ return; } 
		document.getElementById(id).style.backgroundColor="#b6ff81";		
		document.getElementById(id).style.color="black";		
	}
	
	function clearError (id) {
		if (!document.getElementById){ return; } 
		document.getElementById(id).style.backgroundColor="white";		
		document.getElementById(id).style.color="black";		
	}

	/*
		used in admin section to show message of valid tags in text boxed
	*/
	function showMeTags () {
		var text;
		text = "Presentation Tags\n\n";
		text += "Heading 1 use -s1 to open and -e1 to close \n ";
		text += "Heading 2 use -s2 to open and -e2 to close \n ";
		text += "Bold use -sb to open and -eb to close \n\n";
		text += "Color: red use -scred to open and -ec to close \n";
		text += "Color: green use -scgreen to open and -ec to close \n";
		text += "Color: blue use -scblue to open and -ec to close \n";
		text += "Color: TP blue use -scblue to open and -ec to close \n";
		text += "Color: GP green use -scgreen to open and -ec to close \n";

		text += "Eg: -s1this is a test document-e1";
		
		window.alert(text);
	}

	/*
		adds the technipharm link to the ausers favourites
	*/
	function add2fav() {
		if (window.sidebar) {
			window.sidebar.addPanel('TechniPharm - we make farming ezy','http://www.technipharm.co.nz/','');
		} 
		else if (window.external) {
			window.external.AddFavorite('http://www.technipharm.co.nz/','TechniPharm - we make farming ezy');
		} 
		else if (window.opera) {
			 var e = document.createElement('a');
			 e.setAttribute('href','http://www.technipharm.co.nz/');
			 e.setAttribute('title','TechniPharm - we make farming ezy');
			 e.setAttribute('rel','sidebar');
			 e.click();
		}
	}

	function noRmouse() {
		return true;
		var message="Right-mouse click has been disabled.";
		
		function click(e) {
			if (document.all) {
				if (event.button==2||event.button==3) {
					alert(message);
					return false;
				}
			}
			if (document.layers) {
				if (e.which == 3) {
					alert(message);
					return false;
				}
			}
		}
		if (document.layers) {
			document.captureEvents(Event.MOUSEDOWN);
		}
		document.onmousedown=click;
	}

		
	/*	
		showQuickFacts, qideQuickFacts and getScrollY position the quickfacts layer on the screen
		this is where the user enters their email address
	*/
		function showQuickFacts(id) {
			var winW = 630, winH = 460;
			var found=0;
	
			if (parseInt(navigator.appVersion)>3) {
			 if (navigator.appName=="Netscape") {
			  winW = window.innerWidth;
			  winH = window.innerHeight;
			  found=1;
			  
			 }
			 if (navigator.appName.indexOf("Microsoft")!=-1) {
			  winW = document.body.offsetWidth;
			  winH = document.body.offsetHeight;
			  found = 2;
			 }
			}
			
			if (found != 0) {
				box = getStyleObject (id);
				box.style.left= (winW/2)-250;
				box.style.top = (getScrollY() + 150);
				box.style.display="block";
			
				box2 = getStyleObject ('blockscreen');
				box2.style.filter = "alpha(opacity=60)";
				box2.style.display="block";
				box2.style.opacity = "0.95";
				
				box2.style.top=0;
				box2.style.height=document.body.scrollHeight; 
				
			} else {
				window.alert("no dhtml supported");
			}
		}
			
		function hideQuickFacts(id) {
			box = getStyleObject (id);
			box.style.display="none";

			box2 = getStyleObject ('blockscreen');
			box2.style.display="none";
				
		}			
		
		function getScrollY() {
		  var scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			scrOfY = window.pageYOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//DOM compliant
			scrOfY = document.body.scrollTop;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
		  }
		  return scrOfY;
		}
		

