function video_post_hover(todo, box) {
			if (todo=='enter') {
             
            var video_post_hover = $$('.video_post_hover');
						if (video_post_hover!=null) {
								video_post_hover.dispose();
						}
                       onclick = $(box).get('onclick');
						new Element("div", {
								"class": "video_post_hover frontpagehover",
								"html": " ",
								"onclick": onclick
								}).injectAfter($(box));		
				
           
        } else {
						var video_post_hover = $$('.video_post_hover');
						if (video_post_hover!=null) {
								video_post_hover.dispose();
						}		
				}
		}
		
		function hoverThumbs(){
		
						
    $$('.image').addEvent('mouseenter', function(){
        video_post_hover('enter', this);
    });
	
    $$('.left').addEvent('mouseleave', function(){
        video_post_hover('leave', this);
    });
    
						
		}
    
window.addEvent("domready", function() {
    if($('lmk_submit')) {
        $('lmk_submit').addEvent('click', function() {
            $('lmk_error').innerHTML = '';
            if( !validateEmail( $('lmk_email') ) ) {
                 $('lmk_error').innerHTML = 'No valid email!';
            } else if( !$('lmk_country').value ) {
                $('lmk_error').innerHTML = 'Choose a country!';
            } else {
                $('lmk_load').removeClass('hide');
                $('lmk_submit').addClass('hide');
                doAjaxCallback("ajax", "ajax_task=let_me_know&lmk_email="+$('lmk_email').value+"&lmk_country="+$('lmk_country').value, letmeknowpost)
            }
        });
    }
    
    hoverThumbs();
});

function letmeknowpost( result ) {    
    $('lmk_load').addClass('hide');
    $('lmk_submit').removeClass('hide');
    if( result.status > 0 ) {
        if( result.result == 1 ) {
            var $notify = $('notifymenew');
            $notify.addClass('thankyou').innerHTML = result.msg;
        } else {
            $('lmk_error').innerHTML = result.msg;
        }
    } else {
        $('lmk_error').innerHTML = result.msg;
    }
}

function updateTopView(that) {
    var toView = $(that).get('id');
    if (toView) {
        if (toView=="active_users"){
            $('most_watched').removeClass('smallbutton');
            $('most_watched').addClass('smallbuttongray');
            $('active_users').removeClass('smallbuttongray'); 
            $('active_users').addClass('smallbutton');
        }
                   
        if (toView=="most_watched"){
            $('active_users').removeClass('smallbutton');
            $('active_users').addClass('smallbuttongray');
            $('most_watched').removeClass('smallbuttongray'); 
            $('most_watched').addClass('smallbutton');  
        }

        $$('div.toplist .list table').addClass('hide');
        $$('.toplist .list .' + toView).removeClass('hide');
    }
}

function updateUserBox() {
    var user_box = document.getElementById("user_box");
    
    user_box.innerHTML = "<span>"
    + "<fb:profile-pic uid=loggedinuser facebook-logo=true></fb:profile-pic>"
    + "Welcome, <fb:name uid=loggedinuser useyou=false></fb:name>. You are signed in with your Facebook account."
    + "</span>";
    
    // because this is XFBML, we need to tell Facebook to re-process the document
    FB.XFBML.Host.parseDomTree(); 
}