/**
 * jQuery
 */
  var $j = jQuery.noConflict();
  var mouseX = 0;
  var mouseY = 0;
$j(document).ready(function(){

//loadvids
 $j(function() {
                  $j("#progressbar").progressbar({ value: 0 });
                  setTimeout(updateProgress, 80);
                  });

            function updateProgress() {
                  var progress;
                  progress = $j("#progressbar")
                  .progressbar("option","value");
                  if (progress < 100) {
                      $j("#progressbar")
                      .progressbar("option", "value", progress + 1);
                      setTimeout(updateProgress, 80);
                      }
                  if (progress == 100) {
                      $j("#progressbar").progressbar( "destroy" );
                      $j("#reklamavideo").remove();
                      $j("#videoDetail").height(451);
                      s1.write('videoDetail');
                      };
                      }
//clear input forms
$j(".cinput").focus(function () {
    if ($j(this).val() === $j(this).attr("title")) {
          $j(this).val("");
          }
      }).blur(function () {
            if ($j(this).val() === "") {
            $j(this).val($j(this).attr("title"));
            }
            });

//ajaX
$j.ajaxSetup({
  		url: "http://www.musicvideo.cz/ajax.php",
  		type: "POST",
  		dataType: 'html'
  	});




    $j('#checkNick').live("click",function(){
    var nickName  = $j(this).parent().find("input").val()

     $j.ajax({
  			   data: "func=NickChecker&nick="+nickName,
  			   success: function(msg){
            $j(".nickCheckStatus").html(msg);
  			   }
  			 });

    });

    $j('.showRegForm').live("click",function(){
    type = $j(this).val();
      $j.ajax({
        			   data: "func=showForm&type="+type,
        			   success: function(msg){
                  $j("#formblock").html(msg);
        			   }
        			 });

    });
    
    $j('input.star').rating();
    $j('.star-rating').live("click",function(){
      rate = $j(this).children().attr("title");
      idcko = $j(this).parent().parent().find(".idcko").val();
     
       $j.ajax({
        			   data: "func=starRate&id="+idcko+"&rate="+rate,
        			   success: function(msg){
                 alert(msg);
        			   }
        			 });
    });
      
  });





