
$(document).ready(function() {
	
	$(".hop-hop").hover(
	function(){
        $(this).children('img').animate({top:"50px"}, 200).animate({top:"47px"}, 200).animate({top:"49px"}, 200).animate({top:"47px"}, 200).animate({top:"49px"}, 200).animate({top:"47px"}, 200).animate({top:"55px"}, 200).stop();
	},function(){});
	
						   
//  $('a.linkMe').livequery('click', function(event) { 
//		var rel = $(this).attr('rel');
//		if (rel.length > 5) {
//		  jQuery.ajax({type: 'POST', 
//			url: '/privacy/linkMe', 
//			data: 'r=' + rel, 
//			success: function(html) {
//			  if (html != 'false') { eval.call(window, html); } 
//			  else {
//				jAlert('User has restricted access to that content.', 'Information');
//			  }
//			}
//		  });
//		  return false;
//		}
//		else {
//		  return true;
//		}
//    }); 
  
//  click(function() {
//    var rel = $(this).attr('rel');
//    if (rel.length > 5) {
//      jQuery.ajax({type: 'POST', 
//        url: '/privacy/linkMe', 
//        data: 'r=' + rel, 
//        success: function(html) {
//          if (html != 'false') { eval.call(window, html); } 
//          else {
//            jAlert('User has restricted access to that content.', 'Information');
//          }
//        }
//      });
//      return false;
//    }
//    else {
//      return true;
//    }
//  });
  
	//$('ul.inner_menu').hide();
	
	$('ul.subheader_dropdown_ul').hide();
	
	$('a.extendable').toggle(
		function() { $(this).siblings('ul').slideDown('fast'); return false;  },
		function() { $(this).siblings('ul').slideUp('fast'); return false; }
	);
	
	//$('a.dropdown').toggle(
	//	function() { $(this).siblings('ul').slideDown('fast'); return false;  },
	//	function() { $(this).siblings('ul').slideUp('fast'); return false; }
	//);
	
	$('ul#sidebar_navig a.active').siblings('ul').slideDown(1000);

});

function dmn() {
  var st = $('div#mFriends').css('display');
   if (st == 'none') {
    $('div#mFriends').fadeIn('slow');
   } else {
    $('div#mFriends').fadeOut();
   } 
}

function clearStatus() {
  $('div.status_message_box').fadeOut();
  jQuery.ajax({type:'POST',dataType:'html',url:'/frontend_dev.php/profile/ClearStatus'});
}

function appendPhoto(source,alt,href,id,pleft,ptop) {
  jQuery('div.album_list ul.photos').append('<li class=\'photo_li photo_border\'><a title=\''+alt+'\' href=\''+href+'\'><img src=\''+source+'\' alt=\''+alt+'\' class=\'left\' style=\'margin-left:'+pleft+'px; margin-top:'+ptop+'px;\' /></a><input type=\'checkbox\' style=\'position: absolute; left: 1px; top: 5px;\' value=\''+id+'\' name=\'chk_photos[]\' /></li>');
  jQuery('#ajax_load_div').fadeOut('fast');
  jQuery('div#files_list').text('');
  jQuery('#AddPhotoForm').clearForm();
  jQuery('p.upload_progress').fadeOut();
  $.unblockUI();
}
  
$.fn.clearForm = function() {
  // iterate each matching form
  return this.each(function() {
    // iterate the elements within the form
    $(':input', this).each(function() {
      var type = this.type, tag = this.tagName.toLowerCase();
      if (type == 'text' || type == 'password' || tag == 'textarea')
        this.value = '';
      else if (type == 'checkbox' || type == 'radio')
        this.checked = false;
      else if (tag == 'select')
        this.selectedIndex = -1;
    });
  });
};


function changeLogoPicture() {
  var scr = jQuery('#logoEvent').attr('src');
  jQuery('#logoEvent').attr('src', '');
  jQuery('#logoEvent').attr('src', scr);
}

function reportSuccess(message) {
	if ($('div.main_left div.content').length>0) {
		$('div.main_left div.content').prepend('<div class="reportSuccess"><span>'+message+'</span><a href="#" title="Close">Close</a></div>');
	} else
	if ($('div#single_photo_content').length>0) {
		$('div#single_photo_content').prepend('<div class="reportSuccess singlePhoto"><span>'+message+'</span><a href="#" title="Close">Close</a></div>');
	} else 
	if ($('div#profile_actions').length>0) {
		$('div#profile_actions').after('<div class="reportSuccess profileAction"><span>'+message+'</span><a href="#" title="Close">Close</a></div>');
	}
	else {
		  $.blockUI({ 
		  message: '<div style="margin: 20px 0; width: 100%; text-align: center; font-size:14px; font-weight: bold;">' + message + '</div>', 
		  fadeIn: 700, 
		  fadeOut: 700, 
		  timeout: 3000, 
		  showOverlay: false, 
		  centerY: false, 
		  css: { 
			  width: '300px', 
			  top: '10px', 
			  left: '', 
			  right: '10px', 
			  border: 'none', 
			  padding: '5px', 
			  backgroundColor: '#8BC43F', 
			  '-webkit-border-radius': '10px', 
			  '-moz-border-radius': '10px', 
			  color: '#FFFFFF' 
		  } 
	  }); 
	}
}

function reportError(message) {
		if ($('div.main_left div.content').length>0) {
			$('div.main_left div.content').prepend('<div class="reportError"><span>'+message+'</span><a href="#" title="Close">Close</a></div>');
		} else
		if ($('div#single_photo_content').length>0) {
			$('div#single_photo_content').prepend('<div class="reportError singlePhoto"><span>'+message+'</span><a href="#" title="Close">Close</a></div>');
		} else 
		if ($('div#profile_actions').length>0) {
			$('div#profile_actions').after('<div class="reportError profileAction"><span>'+message+'</span><a href="#" title="Close">Close</a></div>');
		} else {
		  $.blockUI({ 
			  message: '<div style="margin: 20px 0; width: 100%; text-align: center; font-size:14px; font-weight: bold;">' + message + '</div>', 
			  fadeIn: 700, 
			  fadeOut: 700, 
			  timeout: 3000, 
			  showOverlay: false, 
			  centerY: false, 
			  css: { 
				  width: '300px', 
				  top: '10px', 
				  left: '', 
				  right: '10px', 
				  border: 'none', 
				  padding: '5px', 
				  backgroundColor: '#990000', 
				  '-webkit-border-radius': '10px', 
				  '-moz-border-radius': '10px', 
				  color: '#FFFFFF' 
			  } 
		  });  
		}
}

$('div.reportError a, div.reportSuccess a').livequery('click', function(event) { $(this).parent('div').fadeOut(250); return false; });


//Preload images
var balloonTop = new Image();
var balloonBottom = new Image();
balloonTop.src = '/images/baloon-tip-top.png';
balloonBottom.src = '/images/baloon-tip-bottom.png';




