function openWin(img,winTitle){
var newWin=window.open(img, '', 'height=130, width=160 resizible');
newWin.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>'+winTitle+'</title></head>');
newWin.document.write('<body><a href="#" onClick="javascript:self.close();"><img src="'+img+'" border="0" /></a></body></html>');
newWin.document.close();
}
function Vote(rate, id, objectup, objectdown) {
	var aa;
	var url = "http://www.registrycleanerz.com/";
	var rup = document.getElementById(objectup);
	var rdown = document.getElementById(objectdown);
	if (rate == 1)
		getData(url+"article_id.php", "vote_article="+id, aa, rup,rdown);
	else
		getData(url+"article_id.php", "unvote_article="+id, aa, rup,rdown);
}

function VoteNews(rate, id, ret) {
	var aa;
	r = document.getElementById(ret);
	
	if (rate == 1)
		getData("http://www.pc1news.com", "vote_news="+id, aa, r);
	else
		getData("http://www.pc1news.com", "unvote_news="+id, aa, r);
}

function getData(requestUrl, requestPost, requestResult, replacementup, replacementdown) {
	var xmlHttpReq = false;
	var self = this;
	if (window.XMLHttpRequest) {
		self.xmlHttpReq = new XMLHttpRequest();
		}
	else if (window.ActiveXObject) {
		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		}
	self.xmlHttpReq.open('POST', requestUrl, true);
	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	self.xmlHttpReq.onreadystatechange = function() {
		if (self.xmlHttpReq.readyState == 4) {
			var temp = self.xmlHttpReq.responseText*1;
            if (temp >= 0)
                replacementup.innerHTML = temp;
            if (temp <= 0)
                replacementdown.innerHTML = temp;
			if (requestResult) window.setTimeout(requestResult+'()', 0);
		}
		}
	self.xmlHttpReq.send(requestPost);
}

var tab = 1;

function showLatest() {
    var url = "http://www.registrycleanerz.com/images/main-page/articles/";
	document.getElementById('article-block-top').style.backgroundImage='url('+url+'article-block-top.png)';
	if (tab == 2) {
		document.getElementById('article-block-content').style.display='';
	}
	tab = 1;
	document.getElementById('top-articles').style.display='none';
	
}

function showTop() {
    var url = "http://www.registrycleanerz.com/images/main-page/articles/";
	document.getElementById('article-block-top').style.backgroundImage='url('+url+'article-block-top2.png)';
	if (tab == 1) {
		document.getElementById('top-articles').style.display='';
	}
	tab = 2;	
	document.getElementById('article-block-content').style.display='none';
}