function load_movies(url){var hash=proccess_hash_search(url,'movie/search/fromcams/true/');if(hash&&url.indexOf('#')==-1){window.location.hash=hash;return;}
var url_new='http://'+window.location.host+'/movie/search/fromcams/true/'+hash;url_new=prepareUrl(url_new);$('#cam_container').animate({opacity:'0.1'},1000);$.ajax({url:url_new,async:true,type:"post",dataType:"json",success:function(data){if(data.success==true){if(data.pager){$('div.paging').empty();;$('div.paging').html(data.pager);}else{$('div.paging').empty();}
if(data.total){$('div.info .total').html(data.total);}else{$('div.info .total').html('0');}
if(data.added){$('div.info .added').html(data.added);}else{$('div.info .added').html('0');}
$('#cam_container').empty().html(data.content);$('#cam_container img').preload({placeholder:presets.image_url+'waiting.jpg',notFound:presets.image_url+'noimage.jpg'});$('#cam_container').animate({opacity:'1'},2000);}else{showFlashData('error','<strong>Sorry.</strong> Something goes wrong...');}}});}
loadMovieCall=function(hash){if(hash==''){hash=proccess_hash_search(window.location.href,'hdlive/archive/');}
if(hash!=''){load_movies(presets.base_url+'movie/search/fromcams/true/#'+hash);}else{load_movies(window.location.href);}
selectHashCombo(hash,'#cam_filter');};$(document).ready(function(){$.historyInit(loadMovieCall);$("#content .sidebar .hd-live select").selectbox({animationSpeed:'fast'});$('div.paging a').live('click',function(){load_movies($(this).attr('href'));return false;});$('#cam_filter input[type=submit]').click(function(){var search_url='';if($('#website').val()){search_url=search_url+'website/'+$('#website').val()+'/';}
if($('#studio').val()){search_url=search_url+'studio/'+$('#studio').val()+'/';}
if($('#series').val()){search_url=search_url+'series/'+$('#series').val()+'/';}
if($('#director').val()){search_url=search_url+'director/'+$('#director').val()+'/';}
if($('#category').val()){search_url=search_url+'category/'+$('#category').val()+'/';}
window.location.hash=search_url;return false;});});

