/**
* @version      $Revision: 1.1$
* @package      Joomla
* @license      GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
var voteext_star, voteext_blank;

function voteext_hideControls(cid)
{
    var container = document.getElementById('content-vote-' + cid);
    if (container)
    {
        container.style.height = '0px';
        container.style.width = '0px';
        container.style.position = 'absolute';
        container.style.display = 'inline';
        container.style.top = '-2000px';
        container.style.left = '-3000px';
        container.style.zIndex = -100;
    }
}

function voteext_rate(rating, cid)
{
    var elm = document.getElementById('user-rating-' + cid);
    if (elm && 'select' == elm.tagName.toLowerCase()) {
        elm.selectedIndex = rating;
    }
    else
    {
        elm = document.getElementById('user-rating-' + cid + '-' + (rating + 1));
        if (elm) elm.click();
    }
    if (elm && elm.form) {
        elm.form.submit();
    }
}

function votext_imgButtonIn(elm)
{
    if ('-' != elm.id.charAt(elm.id.length - 1))
    {
        elm.title = voteext_ratings[elm.id.substring(elm.id.indexOf('-') + 1)];
        elm.id += '-';
    }
    if (voteext_tick)
    {
        if ('blank' == elm.alt) {
            voteext_blank = elm.src;
        }
        else {
            voteext_star = elm.src;
        }
        elm.src = voteext_tick;
    }
    else {
        if ('blank' == elm.alt) elm.src = elm.src.replace(/_blank\.png$/, '.png');
    }
}

function votext_imgButtonOut(elm)
{
    if (voteext_tick) {
        elm.src = 'blank' == elm.alt ? voteext_blank : voteext_star;
    }
    else {
        if ('blank' == elm.alt) elm.src = elm.src.replace(/\.png$/, '_blank.png');
    }
}

