
	  	function ajaxkarma(func,article,resultidx) {
	  	    //alert ('got ' + func + ' and ' + article);
		    var xmlHttpReq = false;
		    var self = this;
		    // Mozilla/Safari
		    if (window.XMLHttpRequest) {
		        self.xmlHttpReq = new XMLHttpRequest();
		    }
		    // IE
		    else if (window.ActiveXObject) {
		        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		    self.xmlHttpReq.open('POST', 'karma.php', true);
		    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		    self.xmlHttpReq.onreadystatechange = function() {
		        if (self.xmlHttpReq.readyState == 4) {
		            updatepage(self.xmlHttpReq.responseText,resultidx);
		        }
		    }
		    self.xmlHttpReq.send(getquerystring(func,article));
		}
		
		function getquerystring(func,article) {
		    qstr = 'func=' + escape(func) + '&newsid=' + escape(article);  // NOTE: no '?' before querystring
		    // alert ('built ' + qstr);
		    return qstr;
		}
		
		function updatepage(str,resultidx){
		    if (resultidx > 0) {
		    	document.getElementById("result" + resultidx).innerHTML = str;
		    }
		    else {
		    	window.location.reload();
		    }
		}
		
		function initScrollLayer() {
			 // hide loading gif
			 var load_lyr = document.getElementById? document.getElementById("loading"): document.all? document.all["loading"]: null;
			 if (load_lyr) load_lyr.style.visibility = "hidden";
			
			 // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll,
			 // if horizontal scrolling, id of element containing scrolling content (table?)
			 var wndo = new dw_scrollObj('wn', 'lyr1', 'imgTbl');
			
			 // Read instructions if your scrolling layers are inside tables
		}		

		function prepareImageSwap(elem,mouseOver,mouseOutRestore,mouseDown,mouseUpRestore,mouseOut,mouseUp) { 
		//Do not delete these comments. 
		//Non-Obtrusive Image Swap Script V1.1 by Hesido.com 
		//Attribution required on all accounts 
		    if (typeof(elem) == 'string') elem = document.getElementById(elem); 
		    if (elem == null) return; 
		    var regg = /(.*)(_hv\.)([^\.]{3,4})$/ 
		    var prel = new Array(), img, imgList, imgsrc, mtchd; 
		    imgList = elem.getElementsByTagName('img'); 
		    for (var i=0; img = imgList[i]; i++) { 
		        if (!img.rolloverSet && img.src.match(regg)) { 
		            mtchd = img.src.match(regg); 
		            img.hoverSRC = mtchd[1]+'_nm.'+ mtchd[3]; 
		            img.outSRC = img.src; 
		            if (typeof(mouseOver) != 'undefined') { 
		                img.hoverSRC = (mouseOver) ? mtchd[1]+'_nm.'+ mtchd[3] : false; 
		                img.outSRC = (mouseOut) ? mtchd[1]+'_ou.'+ mtchd[3] : (mouseOver && mouseOutRestore) ? img.src : false; 
		                img.mdownSRC = (mouseDown) ? mtchd[1]+'_md.' + mtchd[3] : false; 
		                img.mupSRC = (mouseUp) ? mtchd[1]+'_mu.' + mtchd[3] : (mouseOver && mouseDown && mouseUpRestore) ? img.hoverSRC : (mouseDown && mouseUpRestore) ? img.src : false; 
		                } 
		            if (img.hoverSRC) {preLoadImg(img.hoverSRC); img.onmouseover = imgHoverSwap;} 
		            if (img.outSRC) {preLoadImg(img.outSRC); img.onmouseout = imgOutSwap;} 
		            if (img.mdownSRC) {preLoadImg(img.mdownSRC); img.onmousedown = imgMouseDownSwap;} 
		            if (img.mupSRC) {preLoadImg(img.mupSRC); img.onmouseup = imgMouseUpSwap;} 
		            img.rolloverSet = true; 
		        } 
		    } 
		    function preLoadImg(imgSrc) { 
		        prel[prel.length] = new Image(); prel[prel.length-1].src = imgSrc; 
		    } 
		} 
		function imgHoverSwap() {this.src = this.hoverSRC;} 
		function imgOutSwap() {this.src = this.outSRC;} 
		function imgMouseDownSwap() {this.src = this.mdownSRC;} 
		function imgMouseUpSwap() {this.src = this.mupSRC;}

		function roll(obj, highlightcolor, textcolor){
			obj.style.backgroundColor = highlightcolor;
			obj.style.color = textcolor;
		}
		
		function showCommentPopup() {
    			document.getElementById("CommentPopDiv").className == 'popperHid' ? document.getElementById("CommentPopDiv").className = 'popperShow' : document.getElementById("CommentPopDiv").className = 'popperHid';
    			return false;
		}
		function switchMenu(obj) {
			var el = document.getElementById(obj);
			if ( el.style.display != 'none' ) {
				el.style.display = 'none';
			}
			else {
				el.style.display = '';
			}
		}		
