function _nextlist(act,start) {
    query = "s="+start;
    //_getlist(act,query);
    _search(act,start,query);
}


function _tabnext(act,sub1,start) {
    _tab(act,sub1,start);
}

function _tab(act1,sub1,start1) {
     if (start1 == '')
        start1 = 0;
        
     $(document).ready(function(){
        $("#toolexpland").hide("slow");
        $("li").removeClass("selected");
        
        $("#tab_" + act1).addClass("selected");
        //$("#elist").html('<div align=\"center\"><img src=\"http://test.earth247.tv/_graphics/ajax_loader.gif\" /></div>	');
        $.post('/action/video/tab',{act: act1, sub: sub1, start: start1}, function(data) {
          $("#elist").html(data);
        }
        );
        
     });
     
}

function _tool(act1,id1,sub1) {
     
     $(document).ready(function(){
        $("#toolexpland").hide("slow");
        $("#toolexpland").show("slow");
      
        //$("#toolform").html('<img src="/_graphics/ajax_loader.gif" />');
        $.post('/action/video/tool',{act: act1, id: id1, sub: sub1}, function(data) {
          $("#toolform").html(data);
        }
        );
     });
     
}

function _submittool(frm) {
   
   var fname = frm.name;
    
    $(document).ready(function(){
                   
        var variables = $("#" + fname).serialize();
        
		$.post('/action/video/tool',variables,function(data) {
            $("#toolform").html(data);
        });
	    return false;
    });
    
   return false;
}

function _closediv(div) {
    $(document).ready(function(){
        $("#"+div).hide();
     });
}


function _getlist(s,act,query) {
    
    var post = 'act='+act;
    
    if (query != '')
        post = post + '&' + query;
     $("li").removeClass("sel");
     $("#s_" + s).addClass("sel");
    //result = _request(post,'search','vlist');
    _search(act,0,query);
}


function _search(act1,start1,f1) {
     
     $(document).ready(function(){
        
        $.post('/action/video/search',{act: act1, s: start1, f: f1}, function(data) {
          $("#vlist").html(data);
        }
        );
     });
     
}


function _vote(vid1,point) {
     
     $(document).ready(function(){
        
        $.post('/action/video/tool',{act: 'rate', id: vid1, r: point}, function(data) {
          alert(data);
        }
        );
     });
     
}


function _request(post,script,layer) {
    
    var values = '&' + post;
	var url  = 'http://test.earth247.tv/mod/video/' + script + '.php ';
	var req  = false;

    
    if(window.XMLHttpRequest && !(window.ActiveXObject)) {
    try {
		req = new XMLHttpRequest();
       } catch(e) {
		req = false;
       }
    }

	else if(window.ActiveXObject) {
     	try {
       	req = new ActiveXObject("Msxml2.XMLHTTP");
     	} catch(e) {
	       	try {
	         		req = new ActiveXObject("Microsoft.XMLHTTP");
	       	} catch(e) {
	         		req = false;
	       	}
	      }
    }
    
    if (req) {
        req.onreadystatechange = function() {
        
	    if (req.readyState == 4) {

	        if (req.status == 200) {
         
                _div_out(layer,req.responseText);

	        } else {
	            alert("Error :\n" + req.statusText);
	        }
	    }
		}

		req.open("POST", url, true);
		req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		req.send(values);
    }
}

function clickme() {
        $(document).ready(function(){
            //$("#viv_banner").onmouseup(function(){
            $("#viv_banner").hide("slow");
            });
        //});
    }

function clickads() {
        $(document).ready(function(){
           
            $("#viv_banner").hide("slow");
            $("#banner_layer").show("slow");
            });
       
}

/*function overme(vid) {
    //alert("#v_"+vid);   
    //$("#v_"+vid).css("border: 2px solid #999999");
    
    $("#v_"+vid).hover(function () {
      $(this).css({ border:"1px solid #999999", fontWeight:"" });
    }, function () {
      
      $(this).css({ border:"", fontWeight:"" });
    });
    
}*/

