function viewScope(logged,target,cote) {
	if($('#sniper_loaded'+target).css('display')=='none') {
		$('#sniper'+target).animate({
			height: 'show',
			opacity: 'show'
		}, 'slow', function() { 
			fCallAjax(logged,target,cote);
		});
	} else {
		$('#sniper'+target).animate({
			height: 'hide',
			opacity: 'hide'
		}, 'fast', function() {; 
			$('#sniper_loaded'+target).animate({
				height: 'hide',
				opacity: 'hide'
			}, 'fast', function() {
				$('#sniper'+target).css('display','none');
				$('#sniper_loaded'+target).css('display','none');
				$('#sniper_loaded'+target).html('');
			});
		});
	}
}

function viewScopeUser(logged,target,forAjax,cote) {
	if($('#sniper'+target).css('display')=='none') {
		$('#sniper'+target).animate({
			height: 'show',
			opacity: 'show'
		}, 'slow', function() { 
			fCallAjaxUser(logged,target,forAjax,cote);
		}); 
	} else {
		$('#sniper'+target).animate({
			height: 'hide',
			opacity: 'hide'
		}, 'fast', function() {; 
			$('#sniper_loaded'+target).animate({
				height: 'hide',
				opacity: 'hide'
			}, 'fast', function() {
				$('#sniper'+target).css('display','none');
				$('#sniper_loaded'+target).css('display','none');
				$('#sniper_loaded'+target).html('');
			});
		});
	}
}

function fCallAjax(logged,target,cote) {
	
	ord = window.ord || Math.floor(Math.random()*1E16);

	$.ajax({
		type: "GET",
		url: "http://www.cineprofil.com/ajax/sniper_scope.php",
		data: "self="+logged+"&id="+target+"&cote="+cote+"&rndm="+ord,
		contentType: "application/x-www-form-urlencoded;charset=ISO-8859-15",
        dataType: "html", 
		timeout: 5000, 
		error: function (xhr, desc, exceptionobj) {
			$('#sniper'+target).append("Délai dépassé.  Réessayez.");
		},
		success: function(msg){		
			$('#sniper_loaded'+target).html(msg);
			$('#sniper_loaded'+target).animate({
				height: 'show',
				opacity: 'show'
			}, 'slow', function() {
				$('#sniper'+target).animate({
					height: 'hide',
					opacity: 'hide'
				}, 'fast'); 
				$('#sniper'+target).css('display','none');
			});
		}
	});
}

function fCallAjaxUser(logged,target,forAjax,cote) {
	
	ord = window.ord || Math.floor(Math.random()*1E16);

	$.ajax({
		type: "GET",
		url: "http://www.cineprofil.com/ajax/sniper_scope.php",
		data: "self="+logged+"&id="+forAjax+"&cote="+cote+"&rndm="+ord,
		contentType: "application/x-www-form-urlencoded;charset=ISO-8859-15",
        dataType: "html", 
		timeout: 5000, 
		error: function (xhr, desc, exceptionobj) {
			$('#sniper'+target).append("Délai dépassé.  Réessayez.");
		},
		success: function(msg){		
			$('#sniper_loaded'+target).html(msg);
			$('#sniper_loaded'+target).animate({
				height: 'show',
				opacity: 'show'
			}, 'slow', function() {
				$('#sniper'+target).animate({
					height: 'hide',
					opacity: 'hide'
				}, 'fast'); 
				$('#sniper'+target).css('display','none');
			});
		}
	});
}