﻿// JScript File


function ClickOnEnter(e, target) 
{
    if (!e) var e = window.event; 
    if( e.keyCode == 13 ) {
        eval(unescape("" + document.getElementById(target)));
    }
}



function ShowHideOglas(sender, e)
{
    var oglasi = $("tr[rel='" + e + "']");

    for(var i = 0; i< oglasi.length; i++)
    {
        if((oglasi[i].style.display == "") || (oglasi[i].style.display == "none"))
            $(oglasi[i]).show();
        else
            $(oglasi[i]).hide();        
    }
    
    var el = $(sender);
    if(el.text() == "Pogledaj oglase")
        el.text("Zatvori oglase");
    else
        el.text("Pogledaj oglase");    
}


//function ShowHideOglas2(sender, e)
//{
//    var oglasi = $("tr[rel='" + e + "']");
//    oglasi.toggle();
//    
//    var el = $(sender);
//    if(el.text() == "Pogledaj oglase")
//        el.text("Zatvori oglase");
//    else
//        el.text("Pogledaj oglase");
//        
//}



function showAdvSearch()
{
    $("#btnAdvSearch").hide();
    $("#advSearch").show();    
}


function hideAdvSearch()
{
    $("#advSearch").hide();    
    $("#btnAdvSearchHide").show();
    $("#btnAdvSearch").show();
}

function showFlash(containerId, fileUrl, targetUrl, x, y, version)
{
    if(document.getElementById(containerId))
    {
        var so = new SWFObject(fileUrl, "swf" + containerId, x, y, version);        
        so.addParam("MENU", "false");
        so.addParam("quality", "high");
        so.addParam("wmode", "opaque");
        so.addVariable("clickurl", targetUrl);
        so.addVariable("targetattrib", "_blank");
        so.write(containerId);
    }
}
