MediaWiki:Common.js

From WikiVet English
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Any JavaScript here will be loaded for all users on every page load. */

	/* Browser sniffer */
	
	var isIE = false;
	var isOther = false;
	var isNS4 = false;
	var isNS6 = false;
	if(document.getElementById) {
		if(!document.all) {
			isNS6=true;
		}
		if(document.all) {
			isIE=true;
		}
	}
	else {
		if(document.layers) {
			isNS4=true;
		}
		else {
			isOther=true;
		}
	}

	function aL(layerID) {
	var returnLayer;
		if(isIE) {
			returnLayer = eval("document.all." + layerID);
		}
		if(isNS6) {
			returnLayer = eval("document.getElementById('" + layerID + "')");
		}
		if(isNS4) {
			returnLayer = eval("document." + layerID);
		}
		if(isOther) {
			returnLayer = "null";
			alert(cgBrowserAlert);
		}
	return returnLayer;
	}

	function aLs(layerID) {
	var returnLayer;
		if(isIE) {
			returnLayer = aL(layerID).style;
		}
		if(isNS6) {
			returnLayer = aL(layerID).style;
		}
		if(isNS4) {
			returnLayer = aL(layerID);
		}
		if(isOther) {
			returnLayer = "null";
			alert(cgBrowserAlert);
		}
	return returnLayer;
	}
	
	/* Show/Hide Function */
	
		function ShowHide(n) {
		ID = "hideShow" + n;
		IE = "rowa" + n;
		IF = "rowq" + n;
		IG = "roww" + n;
		aLs(ID).visibility = "visible";
		aLs(IE).background = "#EDEDED";
		aLs(IF).background = "#EDEDED";
		aLs(IG).background = "#E5FFE5";
		
	}