function FormFocus(element){if(element.value == element.id){element.value = '';}else if(element.value == ''){element.value = element.id;}}
function setEmbedCode(a, b, c){ z = js_vars.embed_code; z = z.replace("{embed_skin}", a); z = z.replace("{embed_skin}", a); z = z.replace("{embed_width}", b); z = z.replace("{embed_height}", c); $("#video_share").attr('value', z); }
$(document).ready(function(){
$('.commmsg').keyup(function(){var limit = 2000; ($(this).val().length < limit) ? $('.charsLeft').html(limit-$(this).val().length) : $(this).val($(this).val().substr(0,limit)) + $('.charsLeft').html('<span style="background:#cc0000;color:#fff;padding:0 5px">0</span>');});
var userAgent = navigator.userAgent.toLowerCase();
$.vOver = function(){
$('#video li div.videocaption, #avideo li div.videocaption, #cvideo li div.videocaption').css('opacity',0).hide();
$('#video li, #avideo li, #cvideo li').live('mouseenter',function(){if($.browser.msie){$(this).find('div.videocaption').css('opacity',0.8).show();$(this).find('span.vmask').hide();}else{$(this).find('div.videocaption').fadeTo(300,0.8); $(this).find('span.vmask').fadeTo(300,0);}});
$('#video li, #avideo li, #cvideo li').live('mouseleave',function(){if($.browser.msie){$(this).find('span.vmask').show(); $(this).find('div.videocaption').hide();}else{$(this).find('span.vmask').fadeTo(300,1);$(this).find('div.videocaption').fadeTo(300,0);}});
};
$.vOver();
$('.votelike').click(function(){var fval=$(this).attr('id'); var sval=$(this).attr('name'); $('.table_status').hide(); $('.flash').fadeIn('slow'); $.ajax({type: 'POST',url: '/vote-'+ fval +'-'+ sval,cache: false,success: function(html){$('.flash').fadeOut('slow');$('.table_result').html(html);}});});
$('span.fb_share_no_count').each(function(){$(this).removeClass('fb_share_no_count');$('.fb_share_count_inner', this).html('0');});
$('.changeskin a').live('click', function(){$('.changesize').find('span.rectanglesample.selected').each(function(){ c_name = $('span.rectanglesample.selected').attr('id'); }); $('.changeskin').find('span').each(function(){if($('span').hasClass('selected')) $('span.skinsample').removeClass('selected');}); $(this).children('.skinsample').addClass('selected'); dims = c_name.split('x'); s = $(this).attr('id'); a = s.replace('skina',''); b = dims[0].replace('s',''); c = dims[1]; setEmbedCode(a, b, c);});
$('.changesize a').live('click', function(){$('.changeskin').find('span.skinsample.selected').each(function(){ s = $('span.skinsample.selected').attr('id'); }); $('.changesize').find('span').each(function(){if($('span').hasClass('selected')) $('span.rectanglesample').removeClass('selected');}); $(this).children('.rectanglesample').addClass('selected'); c_name = $(this).attr('id'); dims = c_name.split('x'); a = s.replace('skins',''); b = dims[0].replace('a',''); c = dims[1]; setEmbedCode(a, b, c);});
$(document).pngFix();
$("#pageflip").hover(function(){$("#pageflip img , .msg_block").stop() .animate({width: '307px', height: '319px'}, 500);} , function(){$("#pageflip img").stop() .animate({width: '30px', height: '32px'}, 220); $(".msg_block").stop() .animate({width: '30px', height: '30px'}, 200);});
});
function refreshCameras(){$('.camera img').attr('src', function(i, old) { return old.replace(/\?.+/,"?i=" + (Math.random()*3000)); }); setTimeout(refreshCameras, 3000);}
function refreshCamerasFirst(){$('.camera img').attr('src', function(i, old) { return old + "?i=" + (Math.random()*3000); }); setTimeout(refreshCameras, 3000);}
$(function(){setTimeout(refreshCamerasFirst, 3000);});
var cuvinte=window.location.hash.split('#')[1];if(cuvinte!=undefined){document.cookie='cautare='+cuvinte;}else{document.cookie='cautare=';}
var url=self.location.href;var p=url.indexOf("?");var str=url;var parameter=str.slice(p);if(p>=1&&parameter.indexOf("p")!=1){url=str.slice(0,p);self.location.replace(url);}
