function sack(file){this.xmlhttp=null;this.resetData=function(){this.method="POST";this.queryStringSeparator="?";this.argumentSeparator="&";this.URLString="";this.encodeURIString=true;this.execute=false;this.element=null;this.elementObj=null;this.requestFile=file;this.async=true;this.vars=new Object();this.responseStatus=new Array(2);};this.resetFunctions=function(){this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onError=function(){};this.onFail=function(){};};this.reset=function(){this.resetFunctions();this.resetData();};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){this.xmlhttp=null;}}
if(!this.xmlhttp){if(typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest();}else{this.failed=true;}}};this.setVar=function(name,value){this.vars[name]=Array(value,false);};this.encVar=function(name,value,returnvars){if(true==returnvars){return Array(encodeURIComponent(name),encodeURIComponent(value));}else{this.vars[encodeURIComponent(name)]=Array(encodeURIComponent(value),true);}}
this.processURLString=function(string,encode){encoded=encodeURIComponent(this.argumentSeparator);regexp=new RegExp(this.argumentSeparator+"|"+encoded);varArray=string.split(regexp);for(i=0;i<varArray.length;i++){urlVars=varArray[i].split("=");if(true==encode){this.encVar(urlVars[0],urlVars[1]);}else{this.setVar(urlVars[0],urlVars[1]);}}}
this.createURLString=function(urlstring){if(this.encodeURIString&&this.URLString.length){this.processURLString(this.URLString,true);}
if(urlstring){if(this.URLString.length){this.URLString+=this.argumentSeparator+urlstring;}else{this.URLString=urlstring;}}
this.setVar("rndval",new Date().getTime());urlstringtemp=new Array();for(key in this.vars){if(false==this.vars[key][1]&&true==this.encodeURIString){encoded=this.encVar(key,this.vars[key][0],true);delete this.vars[key];this.vars[encoded[0]]=Array(encoded[1],true);key=encoded[0];}
urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0];}
if(urlstring){this.URLString+=this.argumentSeparator+urlstringtemp.join(this.argumentSeparator);}else{this.URLString+=urlstringtemp.join(this.argumentSeparator);}}
this.runResponse=function(){eval(this.response);}
this.runAJAX=function(urlstring){if(this.failed){this.onFail();}else{this.createURLString(urlstring);if(this.element){this.elementObj=document.getElementById(this.element);}
if(this.xmlhttp){var self=this;if(this.method=="GET"){totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString;this.xmlhttp.open(this.method,totalurlstring,this.async);}else{this.xmlhttp.open(this.method,this.requestFile,this.async);try{this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(e){}}
this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;try{self.responseStatus[0]=self.xmlhttp.status;}catch(E){}
try{self.responseStatus[1]=self.xmlhttp.statusText;}catch(E){}
if(self.execute){self.runResponse();}
if(self.elementObj){elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response;}else{self.elementObj.innerHTML=self.response;}}
if(self.responseStatus[0]=="200"){self.onCompletion();}else{self.onError();}
self.URLString="";break;}};this.xmlhttp.send(this.URLString);}}};this.reset();this.createAJAX();}
function signup(element)
{if(element.domain.value.length>9&&element.password.value.length>0)
{return true;}
else
{if(element.password.value.length==0)
{element.password.style.backgroundColor="#FFE970";element.password.focus();}
else
{element.password.style.backgroundColor="#ffffff";}
if(element.domain.value.length<9)
{element.domain.style.backgroundColor="#FFE970";element.domain.focus();}
else
{element.domain.style.backgroundColor="#ffffff";}}
return false;}
function affsignup(element)
{if(element.email.value.length>0&&checkEmail(element.email)&&element.password.value.length>0)
{return true;}
else
{if(element.password.value.length==0)
{element.password.style.backgroundColor="#FFE970";element.password.focus();}
else
{element.password.style.backgroundColor="#ffffff";}
if(element.email.value.length==0||!checkEmail(element.email))
{element.email.style.backgroundColor="#FFE970";element.email.focus();}
else
{element.email.style.backgroundColor="#ffffff";}}
return false;}
function signin(element)
{if(element.domain.value.length>9&&element.password.value.length>0)
{return true;}
else
{if(element.password.value.length==0)
{element.password.style.backgroundColor="#FFE970";element.password.focus();}
else
{element.password.style.backgroundColor="#ffffff";}
if(element.domain.value.length==0)
{element.domain.style.backgroundColor="#FFE970";element.domain.focus();}
else
{element.domain.style.backgroundColor="#ffffff";}}
return false;}
function affsignin(element)
{if(element.email.value.length>0&&checkEmail(element.email)&&element.password.value.length>0)
{return true;}
else
{if(element.password.value.length==0)
{element.password.style.backgroundColor="#FFE970";element.password.focus();}
else
{element.password.style.backgroundColor="#ffffff";}
if(element.email.value.length==0||!checkEmail(element.email))
{element.email.style.backgroundColor="#FFE970";element.email.focus();}
else
{element.email.style.backgroundColor="#ffffff";}}
return false;}
function liveimsignin(element)
{if(element.domain.value.length>9&&element.password.value.length>0)
{return true;}
else
{if(element.password.value.length==0)
{element.password.style.backgroundColor="#FFE970";element.password.focus();}
else
{element.password.style.backgroundColor="#ffffff";}
if(element.domain.value.length==0)
{element.domain.style.backgroundColor="#FFE970";element.domain.focus();}
else
{element.domain.style.backgroundColor="#ffffff";}}
return false;}
function forgot(element)
{if(element.email.value.length>0&&checkEmail(element.email))
{return true;}
else
{if(element.email.value.length==0||!checkEmail(element.email))
{element.email.focus();}}
return false;}
var previewarg='button';function code(arg,domain)
{previewarg=arg;document.getElementById('codecon').innerHTML="&lt;script type='text/javascript' src='http://maxivote.com/"+arg+"/script?domain="+domain+"'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;a href='http://maxivote.com/'&gt;MaxiVote&lt;/a&gt;&lt;/noscript&gt;";}
function preview(domain)
{myWindow=window.open("","preview",'toolbar,width=488,height=295');myWindow.document.write("<script type='text/javascript' src='http://maxivote.com/"+previewarg+"/script&domain="+domain+"'></script>");myWindow.document.close();}
function assist(arg,assist,element)
{amount=0;if(element.checked)
{document.getElementById('s'+arg).style.backgroundColor="#f0f0f0";}
else
{document.getElementById('s'+arg).style.backgroundColor="#ffffff";}
var amount=parseFloat(document.getElementById('amount').value);if(element.checked)
{amount+=assist;}
else
{amount-=assist;}
document.getElementById('amount').value=amount;}
function assistall(element)
{amount=0;for(var i=0;i<document.forms[0].getElementsByTagName('input').length;i++)
{if(document.forms[0].getElementsByTagName('input')[i].type=="checkbox")
{document.forms[0].getElementsByTagName('input')[i].click();}}}
function checkEmail(email)
{var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!filter.test(email.value))
{email.focus();return false;}
return true;}
function select(element)
{expand(element.options[element.selectedIndex].value);location.href="/dashboard#"+element.options[element.selectedIndex].value;}
var amount=0;function timeperiod(element)
{if(amount==0)
{amount=element.form.amount.value;}
if(element.value==1){tmp=amount;}
else if(element.value==2){tmp=(amount-amount*0.10)*2;}
else if(element.value==3){tmp=(amount-amount*0.15)*3;}
else if(element.value==4){tmp=(amount-amount*0.20)*4;}
else if(element.value==5){tmp=(amount-amount*0.25)*5;}
else if(element.value==6){tmp=(amount-amount*0.30)*6;}
element.form.amount.value=tmp;}
function addmonitor(element)
{if(element.name.value.length>0&&element.url.value.length>0)
{return true;}
else
{if(element.url.value.length==0)
{element.url.style.backgroundColor="#FFE970";element.url.focus();}
else
{element.url.style.backgroundColor="#ffffff";}
if(element.name.value.length==0)
{element.name.style.backgroundColor="#FFE970";element.name.focus();}
else
{element.name.style.backgroundColor="#ffffff";}}
return false;}
function link(element)
{if(element.username.value.length>0)
{return true;}
else
{if(element.username.value.length==0)
{element.username.style.backgroundColor="#FFE970";element.username.focus();}
else
{element.username.style.backgroundColor="#ffffff";}}
return false;}
function addemail(element)
{if(element.email.value.length>0&& checkEmail(element.email))
{return true;}
else
{if(element.email.value.length==0)
{element.email.style.backgroundColor="#FFE970";element.email.focus();}
else
{element.email.style.backgroundColor="#ffffff";}}
return false;}
function expand(id)
{if(jQuery('#f'+id+' table').is(":visible"))
{jQuery('#f'+id+' table').css('display','none');}
else
{jQuery('#f'+id+' table').css('display','block');}}
jQuery(document).ready(function(){jQuery('a.what').click(function(){if(jQuery('div.home').css('margin-top').replace("px","")<0){var move=545;if(jQuery('div.home').css('margin-top').replace("px","")=="-737"){move=737}
else{jQuery('div.monitor').animate({top:'+='+move},500,function(){});jQuery('a.advertisebutton').animate({top:'+='+move},500,function(){});jQuery('a.pricingbutton').animate({top:'+='+move},500,function(){});jQuery('a.windowbutton').animate({top:'+='+move},500,function(){});}
jQuery('div.home').animate({marginTop:'+='+move},500,function(){});}
return false;});});function bannercode(arg,id)
{document.getElementById('codecon').innerHTML='&lt;a href="http://maxivote.com/affiliate/'+id+'" title="MaxiVote"&gt;&lt;img src="http://maxivote.com/includes/'+arg+'" alt="MaxiVote" /&gt;&lt;/a&gt;';}
