$(document).ready(function () {
	$('#search-tc input').live("keyup", function(){
		 $.ajax({  
	 			 type: 'POST',  
				 url: '?c=testcenter&m=filter',  
	 			 data: $('#search-tc').serialize(), 
				 success: function(responseText) { 
	                $('#search-tc-results').html(responseText);
	            	}
		});							 						
	});
	
	
	$('#login_or').live("click",function(){
		if(!$('#login-dida').length){
			$('#logged_user').addClass('active');
			$('#logged_user').animate({'height':150},{duration:200,easing:'easeOutExpo'}).animate({'width':320},{duration:200,easing:'easeOutExpo'});	
			$('#login_or').after('<div id="login-dida" class="login-dida" style="display:none">login</div>');
			myGet('login-dida','?c=www&m=login_dida');
			$('#login-dida').fadeIn();
		
		}
	});
	
	$('#login_dida_exit').live("click",function(){
		$('#login-dida').fadeOut();
		$('#login-dida').remove();
		$('#logged_user').removeClass('active').animate({'width':100},{duration:200,easing:'easeOutExpo'}).animate({'height':20},{duration:200,easing:'easeOutExpo'});		
	});

});

			
function myGet(tgt,url){
	$.ajax({  
 			 type: 'POST',  
			 url: url,  
			 success: function(responseText) { 
                $('#'+tgt).html(responseText);
            }
	});
}


function loadContent(tag,id,trigger){
		
		$('.currentTrigger').removeClass('currentTrigger');
		
		$('#'+trigger).addClass('currentTrigger');
		
		$.ajax({  
 			 type: 'GET',  
			 url: '?c=www&m=loadContent&id='+id,  
			 success: function(responseText) { 
                $('#'+tag).html(responseText);
            }
		});
		$('#location-memory').val('?c=www&m=loadContent&id='+id);
}

function jumper(c,id){

	$.ajax({  
 			 type: 'GET',  
			 url: '?c='+c+'&m=loadContent&id='+id,  
			 success: function(responseText) { 
                $('#content-article').html(responseText);
            }
		});

}

function openContact(ct,title){
	
	if(!title){ title = 'info'; }

	$.fn.colorbox({href:'?c=forms&m=standard_info&title=info&economic='+ct});

}
