/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function submitComment()
{
    $('#comment-form').submit();
    /*
     *THIS WAS COMMENTED BECAUSE OF INTERNET EXPLODER. REST IN PIECES stupid browser!
    if ($('#comment').val().trim() != '') {
        $('#comment-form').submit();
    } else {
        alert('Въведете коментар!');
    }*/
}

function commentInsertSmilie(smilie)
{
    var comment = $('#comment').val();
    comment += ' ' + smilie + ' ';
    $('#comment').val(comment);
    $('#comment').focus();
}

function removeComment(uri)
{
    if (confirm('Желаете ли да изтриете този коментар?')) {
        location.href = uri;
    }
}

function imageGalleryLoad(hash) {
    if(hash) {
        // restore ajax loaded state
        if($.browser.msie) {
            // jquery's $.load() function does't work when hash include special characters like aao.
            hash = encodeURIComponent(hash);
        }
        $("#leftside").load('/img.php?hash=' + hash);
    } else {
        // start page
        $("#load").empty();
    }
}

function popWin(winLink, pageWidth, pageHeight) {
    var scrollbar = false; resizable = false;
    var randomNum = Math.random()*1000000;
    var winWidth = pageWidth + 20; var winHeight = pageHeight + 20;
    randomNum = parseInt(randomNum); if(isNaN(randomNum)) randomNum = 344544;
    var winName = 'outdoordating_popup_'+randomNum;
    if (scrollbar) { scrollbar = ',scrollbars'; } else { scrollbar=''; };
    if (resizable) { resizable = ',resizable'; } else { resizable=''; };
    var winX = (window.screen.width / 2) - (winWidth / 2);
    var winY = (window.screen.height / 2) - (winHeight / 2);
    popup=window.open("", winName, "width="+winWidth+" ,height="+winHeight +
        resizable+scrollbar+",left="+winX+",top="+winY);
    popup.document.location = winLink; popup.self.focus();
};

function askRemoveBlog(url)
{
    if (confirm('Сигурни ли сте, че желаете да изтриете поста?')) {
        location.href = url;
    }
}


$(document).ready(function() {
    $("#rotator").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 4000);
});

