
function renderTabs(selected)
{
if(!selected) selected = 0;
renderSimpleTabs({tabs: ".genres_tabs", contentTabsPrefix:"#genres_tabs_content", titles:["Жанры","Города"], selected: selected});
}
//simpleTabs
renderSimpleTabs = function(options)
{
if(!options.selected) options.selected=0;
options.startDivTemplate="<div class='big_block_top' id='nobg'>";
options.endDivTemplate="</div>";
options.selectedTabTemplate="<span><strong>{%title%}</strong></span>";
options.linkTabTemplate="<a href=\"#tab{%index%}\"><strong>{%title%}</strong></a>"; 
if(options.selected == 1)
{
$('#sub_genres_block').hide();
}
else
{
$('#sub_genres_block').show();
}
tabsWork(options);
//click
$(options.tabs + " a").click(
function (o) {	
var newSelected = this.hash.replace("#tab", "");
options.selected = newSelected;
renderSimpleTabs(options);
return false;
}
);
}


//tabsWork
function tabsWork(options)
{
var contentTabs = '';
for(var i=0; i < options.titles.length; i++)
{
if (contentTabs.length>0) contentTabs+=','; 
contentTabs += options.contentTabsPrefix+ i.toString();
}
//alert(contentTabs);
$(contentTabs).hide().filter(':eq(' + options.selected + ')').show();
var html = '';
html+=options.startDivTemplate;
//alert(options.startDivTemplate);
for(var i=0; i < options.titles.length; i++)
{
if (i == options.selected)
{
html+=options.selectedTabTemplate.replace("{%title%}",options.titles[i]);
}
else
{ 
html+=options.linkTabTemplate.replace("{%title%}",options.titles[i]).replace("{%index%}",i); 
}
} 
html+=options.endDivTemplate;
//alert(html);
$(options.tabs).html(html);
}


$(document).ready(function() {

$('#a_sort, #selected_mode').click(function(){
$('#dropdown').show();
return false;
});

$("#dropdown").mouseover(function(){
//alert("over");
$("#dropdown").show();
}).mouseout(function(){
//alert("out");
$("#dropdown").hide();
})
});


