﻿var cot_loc0=(window.location.protocol == "https:")? "https://secure.comodo.net/trustlogo/javascript/cot.js" :
        "http://www.trustlogo.com/trustlogo/javascript/cot.js";
        document.writeln('<scr' + 'ipt language="JavaScript" src="'+cot_loc0+'" type="text\/javascript">' + '<\/scr' + 'ipt>');

function ShowTerms()
{
    document.getElementById("t").style.left = (document.body.clientWidth-464)/2 + " px";
    document.getElementById("terms").style.display = "block";
}

function ShowPrivacy()
{
    document.getElementById("p").style.left = (document.body.clientWidth-464)/2 + " px";
    document.getElementById("privacy").style.display = "block";
}

function ShowRules()
{
    document.getElementById("r").style.left = (document.body.clientWidth-464)/2 + " px";
    document.getElementById("rules").style.display = "block";
}

function ShowHelp()
{
    document.getElementById("h").style.left = (document.body.clientWidth-464)/2 + " px";
    document.getElementById("help").style.display = "block";
}

function HideHelp()
{
    document.getElementById("help").style.display = "none";
}

function HidePrivacy()
{
    document.getElementById("privacy").style.display = "none";
}

function HideTerms()
{
    document.getElementById("terms").style.display = "none";
}

function HideRules()
{
    document.getElementById("rules").style.display = "none";
}

var dragobject={
z: 0, x: 0, y: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0,
initialize:function(){
document.onmousedown=this.drag
document.onmouseup=function(){this.dragapproved=0}
},
drag:function(e){
var evtobj=window.event? window.event : e
this.targetobj=window.event? event.srcElement : e.target
if (this.targetobj.className=="drag"){
this.dragapproved=1
if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0}
if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0}
this.offsetx=parseInt(this.targetobj.style.left)
this.offsety=parseInt(this.targetobj.style.top)
this.x=evtobj.clientX
this.y=evtobj.clientY
if (evtobj.preventDefault)
evtobj.preventDefault()
document.onmousemove=dragobject.moveit
}
},
moveit:function(e){
var evtobj=window.event? window.event : e
if (this.dragapproved==1){
this.targetobj.style.left=this.offsetx+evtobj.clientX-this.x+"px"
this.targetobj.style.top=this.offsety+evtobj.clientY-this.y+"px"
return false
}
}
}

dragobject.initialize()

function SetRating(id, uid, r)
{
    var xmlHttp;
    try
    {    // Firefox, Opera 8.0+, Safari    
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {    
        // Internet Explorer    
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");        
                return false;
            }
        }    
    }
    
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState==4)
        {
            SetVoting("?id="+id);
        }
    }
    
    xmlHttp.open("GET","rate.aspx?id="+id+"&uid="+uid+"&r="+r,true);
    xmlHttp.send(null);
}

function hl1()
{
    if(document.getElementById("lnkStar1").className == "star")
    {
        document.getElementById("lnkStar1").className = "star-hover";
    }
}

function hl2()
{
    if(document.getElementById("lnkStar1").className == "star")
    {
        document.getElementById("lnkStar1").className = "star-hover";
        document.getElementById("lnkStar2").className = "star-hover";
    }
}

function hl3()
{
    if(document.getElementById("lnkStar1").className == "star")
    {
        hl2();
        document.getElementById("lnkStar2").className = "star-hover";
        document.getElementById("lnkStar3").className = "star-hover";
    }
}

function hl4()
{
    if(document.getElementById("lnkStar1").className == "star")
    {
        hl3();
        document.getElementById("lnkStar3").className = "star-hover";
        document.getElementById("lnkStar4").className = "star-hover";
    }
}

function hl5()
{
    if(document.getElementById("lnkStar1").className == "star")
    {
        hl4();
        document.getElementById("lnkStar4").className = "star-hover";
        document.getElementById("lnkStar5").className = "star-hover";
    }
}

function uhl1()
{
    if(document.getElementById("lnkStar1").className == "star-hover")
    {
        document.getElementById("lnkStar1").className = "star";    
    }
}

function uhl2()
{
    if(document.getElementById("lnkStar1").className == "star-hover")
    {
        document.getElementById("lnkStar1").className = "star";    
        document.getElementById("lnkStar2").className = "star";
    }
}

function uhl3()
{
    if(document.getElementById("lnkStar1").className == "star-hover")
    {
        uhl2();
        document.getElementById("lnkStar2").className = "star";
        document.getElementById("lnkStar3").className = "star";
    }
}

function uhl4()
{
    if(document.getElementById("lnkStar1").className == "star-hover")
    {
        uhl3();
        document.getElementById("lnkStar3").className = "star";
        document.getElementById("lnkStar4").className = "star";
    }
}

function uhl5()
{
    if(document.getElementById("lnkStar1").className == "star-hover")
    {
        uhl4();
        document.getElementById("lnkStar4").className = "star";
        document.getElementById("lnkStar5").className = "star";
    }
}

function cl1()
{
    document.getElementById("lnkStar1").className = "star-voted";
}

function cl2()
{
    cl1();
    document.getElementById("lnkStar2").className = "star-voted";
}

function cl3()
{
    cl2();
    document.getElementById("lnkStar3").className = "star-voted";
}

function cl4()
{
    cl3();
    document.getElementById("lnkStar4").className = "star-voted";
}

function cl5()
{
    cl4();
    document.getElementById("lnkStar5").className = "star-voted";
    alert("cl5");
}

function SetVoting(url)
{
    var xmlHttp;
    try
    {    // Firefox, Opera 8.0+, Safari    
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {    
        // Internet Explorer    
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");        
                return false;
            }
        }    
    }
    
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState==4)
        {
            document.getElementById("vote").innerHTML = xmlHttp.responseText;
        }
    }
    
    i1 = url.indexOf("?id=")+4;
    i2 = url.length;
    id=url.substring(i1,i2);
    
    xmlHttp.open("GET","voting.aspx?id="+id,true);
    xmlHttp.send(null);
}

function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;