
var effacable = true;
var chemin = 'http://www.streaming3000.com';
			

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18122116-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
	
function nextFilm(){
$("#resboite").html("<img src=\"images/loading.gif\" width=\"100\" alt=\"chargement\" height=\"100\"/>");
$("#next").attr({disabled:true});

	$.ajax({
	type:"POST",
	url:chemin+"/fonctions/hasard.php",
	data:"action=oki",
	success:function(txt){
		$("#resboite").html(txt);
		$("#next").attr({disabled:false});
	}
	});

}

$("#voirboite").live("click", function(){

var lien = $("#resboite a").attr("href");
window.location = lien;
});




function effacer(){
	if(effacable == true){
		$("#input_recherche").val("");
		effacable = false;
	}

}


	
$(document).ready(function(){


$("#formu_debrideur").bind("submit",function(){
	var link = $("#lien_debrideur").val();
	var estValide = true;
	
	if(link.length < 15){
		$("#err_debrideur").html("L'url est trop court.");
		estValide = false;
	}

	
	else { 
			if(!(link.toString().match(/http:\/\//i))){
				$("#err_debrideur").html("L'url doit contenir http://");
				estValide = false;
			}
			
			if(!(link.toString().match(/megavideo/i)) && !(link.toString().match(/videobb/i)) && !(link.toString().match(/videozer/i))){
				$("#err_debrideur").html("Le lien n'est pas valide.");
				estValide = false;
			}
	}
	
	if(estValide==true){
		$("#err_debrideur").html("");
		$("#aff_video").html('<img src="'+chemin+'/images/loading.gif" id="loading_debrid" width="100" height="100" title="Patientez..." alt="Patientez.." />');
		
		
		
		$.ajax({
		type:"POST",
		url:chemin+"/debrideurs/debrideur.php",
		data:"lien="+link,
		success:function(txt){
			$("#aff_video").html(txt);
			
		}
		});
	}


	return false;
});

	
	
if(jQuery.browser.msie && jQuery.browser.version <=6){

	$("#logo").html('<a href="'+chemin+'/index.html" title="accueil"><img src="'+chemin+'/images/ie6/logo.gif" width="287" height="56" alt="Logo"/></a>');
	
}



	
	$("#lienmort").click(function(){var idl=$(this).children('span.spanito').html();
	$(this).html("<img src=\""+chemin+"/images/ui-anim_basic_16x16.gif\" \>");
	$.ajax({type:"POST",url:"../fonctions/signaler.php?t=films",data:"idl="+idl,complete:function(data){$("#lien_mort").html(data.responseText);}})});
	
	$("#lienmorts").click(function(){var idl=$(this).children('span.spanito').html();
	$(this).html("<img src=\""+chemin+"/images/ui-anim_basic_16x16.gif\" \>");
	$.ajax({type:"POST",url:"../fonctions/signaler.php?t=series",data:"idl="+idl,complete:function(data){$("#lien_mort").html(data.responseText);}})});

	


});


 String.prototype.noaccent = function() {  
   return this.replace(/[àâä]/gi,"a").replace(/[éèêë]/gi,"e").replace(/[îï]/gi,"i").replace(/[ôö]/gi,"o").replace(/[ùûü]/gi,"u");  
 };  
   


jQuery.expr[':'].Contains = function(a,i,m){
     return jQuery(a).text().noaccent().toUpperCase().indexOf(m[3].noaccent().toUpperCase())>=0;
};



(function($) {
$.fn.toolTips = function(settings) {
    options =  {
        offsetX:  10,
        offsetY:  -5,
        baseLine: 'top',
        delay:    200,
        click:    true

    };
    var options = $.extend(options, settings);

    return this.each(function(){
        var $$ = $(this);
        var aTitle   =  $$.children('div.spanito').html()  || ''; 
		
		var aToolTip = $("<div></div>");
        var aCaption = '';
        var aImage;   var timer;
        var offsetX = 1;
        var offsetY = 1;
        $$.mouseover(function(e) {

            if (aTitle != '') {
                aCaption = '<div class="toolTip-caption"><span>'+ aTitle +'</span></div>';
            }
			
			
			
				 $$.find("h3 a").css("text-decoration","underline");
				  $$.find("a img").css("border","1px solid #1798C8");
                aToolTip = $("<div class='toolTip-text'><span>"+ aTitle +"</span></div>");

            aToolTip.appendTo("body").hide().css({ position:'absolute', top:0, left:0 });

            $$.mousemove(function(e) {
                aToolTip.css({
                    left: e.pageX + offsetX + "px",
                    top:  e.pageY + offsetY + "px"
                });
            });

            timer = setTimeout( function() { aToolTip.show() }, options.delay);
        })

        $$.mouseout(function(e) {
            clearTimeout(timer);
			$$.find("h3 a").css("text-decoration","none");
			$$.find("a img").css("border","1px solid white");
            $$.unbind("mousemove");
            aToolTip.remove();
        });

		$$.find("a").click(function(e) {
           clearTimeout(timer);
            $$.unbind("mousemove");
            aToolTip.remove();
        });
        $$.click(function() {
           return options.click;
        });
    });
};
})(jQuery);


			   function goTo(ancre){jQuery('html,body').animate({scrollTop:jQuery(ancre).offset().top},1500,'swing',function(){
			          if(ancre != 'body')
			                window.location.hash = ancre;
			          else
			              window.location.hash = '#';
			          jQuery(ancre).attr('tabindex','-1');
			          jQuery(ancre).focus();
			          jQuery(ancre).removeAttr('tabindex');
					   jQuery(ancre).blur();
					
			      });
			    }
		
		
				


