/**
	Javascript Chaining Library
	
	http://www.rudiv.se/
	Copyright © 2009 Rudi Visser
	
	Detta verk är licensierat under Creative Commons Erkännande-Dela Lika 2.5 Sverige licens. http://creativecommons.org/licenses/by-sa/2.5/se/
	För att se en kopia av denna licens, besök http://creativecommons.org/licenses/by-sa/2.5/se/ eller skicka ett brev till Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
**/
var IE=/*@cc_on!@*/false;
var http = (IE?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest());
var gE=function(element){return wrap(document.getElementById(element))};var cE=function(element){return wrap(document.createElement(element))};var tN=function(text){return document.createTextNode(text)};var lI=function(url){var tmp=new Image();tmp.src=url;return true};

var gA = function(url,nocache,success,failure) { 
	http.open('GET',url+(nocache?"&"+Math.random():""));
	http.onreadystatechange = function() {
		if (http.readyState==4 && http.status==200) {
			success(http.responseText);
		} else if (http.readyState==4) {
			failure();
		}
	}
	http.send(null);
}

function wrap(node){if(typeof node=='string'){node=$id(node)}for(var key in __DOMShortcuts){if(typeof node[key]=='undefined'){node[key]=__DOMShortcuts[key]}}return node}var __DOMShortcuts={aC:function(node){return this.appendChild(node)},tC:function(toTry,toCatch){try{toTry(this)}catch(e){toCatch(this,e)};return this},sW:function(newWidth){this.style.width=newWidth;return this},sH:function(newHeight){this.style.height=newHeight;return this},sD:function(newDisp){this.style.display=newDisp;return this},sC:function(newCol){this.style.color=newCol;return this},sBC:function(newCol){this.style.backgroundColor=newCol;return this},sFS:function(newFS){this.style.fontSize=newFS;return this},cN:function(className){this.className=className;return this},tA:function(textAlign){this.style.textAlign=textAlign;return this},sP:function(padding){this.style.padding=padding;return this},sM:function(margin){this.style.margin=margin;return this},sFF:function(family){this.style.fontFamily=family;return this},sB:function(border){this.style.border=border;return this},sO:function(overflow){this.style.overflow=overflow;return this},sCu:function(cursor){this.style.cursor=cursor;return this},sPo:function(position){this.style.position=position;return this},sAT:function(newVal){this.style.top=newVal;return this},sAR:function(newVal){this.style.right=newVal;return this},sAL:function(newVal){this.style.left=newVal;return this},sAB:function(newVal){this.style.bottom=newVal;return this},sN:function(newName){this.name=newName;return this},sV:function(newValue){this.value=newValue;return this},sA:function(att,val){this.setAttribute(att,val);return this},sID:function(newID){this.id=newID;return this},oC:function(oCfunc){this.onclick=oCfunc;return this},oMO:function(oMOfunc){this.onmouseover=oMOfunc;return this},oMOu:function(oMOfunc){this.onmouseout=oMOfunc;return this},iT:function(newiT){this.innerText=newiT;return this},iH:function(newiH,ret){if(newiH==null&&ret==true){return this.innerHTML}else{this.innerHTML=newiH;if(ret==true){return this.innerHTML}else{return this}}}};

function DoVote(Ex, VT) {
	gA('/java/worker.php?ex=' + Ex + '&vt=' + VT, true, function(response) { gE('votehtml-'+Ex).iH(response); }, function() { gE('votehtml-'+Ex).iH('Voting Failed. Please Refresh and try again!'); });
}
