function choose_hide_efect(str) {
		$('#e_forms').slideUp(400);
		$('#over_layer').css('opacity','0');
		$('#over_layer').css('display','block');
		var choos = Math.floor(Math.random()*4);		
		switch (choos)
		{
		case 0: {
		  hide_func1(str);
		  break;
		}
		case 1:{
		  hide_func2(str);
		  break;
		}
		case 2:{
		  hide_func4(str);
		  break;
		}
		case 3:{
		  hide_func2(str);
		  break;
		}
		default:
		 
		}	
			
		}
function choose_show_efect() {
		var choos = Math.floor(Math.random()*4);		
		switch (choos)
		{
		case 0: {
		  show_func1();
		  break;
		}
		case 1:{
		  show_func2();
		  break;
		}
		case 2:{
		  show_func3();
		  break;
		}
		case 3:{
		  show_func4();
		  break;
		}
		default:
		 
		}}
function hide_func1(str) {
		
		$('#main_win').animate({
							
							height: '100%',
							top   : '100%',
							opacity : '0'
						 
						  }, 1000, function() {
							  core(str);
							  
							  }); }
function hide_func2(str) {
	 $('#main_win').animate({
													left : '-100%',
													top  : '-100%'													
													}
													,700,function(){
													$(this).css('opacity','0');
													  core(str);
													});	 }
function hide_func3(str) {
	var degr = 1;
	for ( var i=0;i<100;i++ ){
		$("#main_win").animate({
								opacity:(360-(i*4))/100,
								height:(100-i)+"%",
								width: (100-i)+"%",
								top: (i)/2+"%",
								left:(i)/2+"%"
								},1,function(){
														
								degr++;
								degrees = degr*5
								if ($.browser.msie) {
									// $("#main_win") fix unearthed from:
									// http://msdn.microsoft.com/en-us/library/ms533014%28v=vs.85%29.aspx
									// A simple explanation that [MXX] uses the sine and cosine of radians
									// instead of degrees would have sped up the search quite a bit... 
									// But why would we want adequate and verbose documentation??
									// Who enjoys actually getting work done anyway?? Srsly...
									deg2radians = Math.PI * 2 / 360;
									rad = degrees * deg2radians ;
									costheta = Math.cos(rad);
									sintheta = Math.sin(rad);
									 
									M11 = costheta;
									M12 = -sintheta;
									M21 = sintheta;
									M22 = costheta;
									
									msUglyStepdaughterCode = "progid:DXImageTransform.Microsoft.Matrix(";
									msUglyStepdaughterCode += "M11=" + M11 + ", M12=" + M12 + ", M21=" + M21 + ", M22=" + M22;
									msUglyStepdaughterCode += ", sizingMethod='auto expand')"
									
									$("#main_win").css("-ms-transform","rotate(" + degrees + "deg)");
									$("#main_win").css("filter",msUglyStepdaughterCode);
									$("#main_win").css("zoom","1");
								} else if ($.browser.webkit) {
									$("#main_win").css("-webkit-transform","rotate(" + degrees + "deg)");
								} else if ($.browser.opera) {
									$("#main_win").css("-o-transform","rotate(" + degrees + "deg)");
								} else if ($.browser.mozilla) {
									$("#main_win").css("-moz-transform","rotate(" + degrees + "deg)");
								} else {
									$("#main_win").css("transform","rotate(" + degrees + "deg)");
								}
								
							
								});
	}
	//
	$("#main_win").delay(500).animate({
									   opacity: '0'
									   },10,function(){
										  $("#main_win").removeAttr("style");
										  $("#main_win").css('opacity','0');
										   core(str);
										   });
	
	}
function hide_func4(str) {
		$('#main_win').animate({
					    	left : "-100%",
							opacity:'0'
						  }, 1000, function() {
							    core(str);
							  }); }
function core(str){	
				$(".wait").css('display','block');
				$.ajax({
				type: "POST",
				url: 'core.php',
				data: str,
				success: function(msg){
					$('#main_content').html( msg );
					$('#main_content').css('display','block');
					$('#main_content').css('left','0');
					choose_show_efect();
					
					$(".wait").css('display','none');
					
			   }
			   });	}
function core2(target_id,str){	
				$('#e_forms').slideUp(400);
				$(".wait").css('display','block');
				$.ajax({
				type: "POST",
				url: 'core.php',
				data: str,
				success: function(msg){
					$('#'+target_id).fadeOut(500,function(){
														  $('#'+target_id).html( msg );
														  $('#'+target_id).fadeIn(800);
														  });
					
					$(".wait").css('display','none');
					
			   }
			   });	}
function core_eforms(target_id,str){	
				$(".wait").css('display','block');
				$.ajax({
				type: "POST",
				url: 'core.php',
				data: str,
				success: function(msg){
					$('#'+target_id).fadeOut(500,function(){
														  $('#'+target_id).html( msg );
														  $('#'+target_id).fadeIn(800);
														  });
					
					$(".wait").css('display','none');
					
			   }
			   });	}
function show_func1() {
		
		$('#main_win').css('top','40px');	
		$('#main_win').css('left','0');	
		$('#main_win').css('height','0');
		$('#main_win').css('width','100%');
		
		$('#main_win').animate({
							   height:"100%",
							  
							   opacity : '1'
							   },900,function(){
									show_content();   
							   });}
function show_func2() {
		
		$('#main_win').css('top','40px');	
		$('#main_win').css('left','0');	
		$('#main_win').css('height','100%');
		$('#main_win').css('width','0');
		
		$('#main_win').animate({
							   width:"100%",
							  
							   opacity : '1'
							   },900,function(){
									show_content();   
							   });}
function show_func3() {
		
		$('#main_win').css('top','50%');	
		$('#main_win').css('left','50%');	
		$('#main_win').css('height','0');
		$('#main_win').css('width','0');
		
		$('#main_win').animate({
							   width:"100%",
							   height:"100%",
							   top : '40px',
							   left:'0',
							   opacity : '1'
							   },900,function(){
									show_content();   
							   });}
function show_func4() {
		
		$('#main_win').css('top','40px');	
		$('#main_win').css('left','');	
		$('#main_win').css('height','100%');
		$('#main_win').css('width','100$');
		$('#main_win').fadeTo(700,1,function(){
									show_content();   
							   });
		}
function show_content() {
	
		$('#over_layer').css('display','none');  
			 }
function e_forms (str){
				$('#e_forms').slideUp(400);
				$(".wait").css('display','block');
				$.ajax({
				type: "POST",
				url: 'core.php',
				data: str,
				success: function(msg){
					$('#e_forms').html( msg );
					$('#e_forms').slideDown(800);
					$(".wait").css('display','none');
					
			   }
			   });			
}
