$(document).ready(function() {
						   
	$("#frame_login").click(function(){
		
		$.fancybox({
			'width'				: 500,
			'height'			: 180,
			'autoScale'			: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type': 'iframe',
			'href': web_url+'index.php?m=member&a=login'
		});

	});
						   
	$("#frame_login_close").click(function(){
		
		window.parent.location.reload();

	});

						   
	$("#frame_dictionary_tell_friends").click(function(){
		
		//alert($("#k").val());
		
		var keyword = $("#k").val();
			
		$.fancybox({
			'width'				: 500,
			'height'			: 400,
			'autoScale'			: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type': 'iframe',
			'href': web_url+'index.php?m=dictionary&a=frame_tell_friends&keyword='+keyword
		});

	});	
						   
	$("#frame_dictionary_photo").click(function(){
											
		$.fancybox({
			'autoScale'			: true,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'titlePosition'		: 'over',
			'href'				: web_url+$("#frame_dictionary_photo").val()
		});

	});	
	
	
});

function CheckFormSubmit() {
   document.getElementById('btnConfirm').disabled = true;
   return true;
}

function CheckFormSubmit2() {
   document.getElementById('btnConfirm2').disabled = true;
   return true;
}

function getDictionaryPhoto(file) {
	document.getElementById("frame_dictionary_photo").value = file;
	document.getElementById("frame_dictionary_photo").click();
}

function changeDicFavorite(elem_id){
	
	var listItem 	= $("#"+elem_id);
	var index1		= $('a.dicid').index(listItem); //alert(index1);
	var dic_id		= $("#"+elem_id).attr('rel'); //alert(dic_id);
											  
	$.post(
		web_url+'index.php?m=dictionary&a=favorite&dic_id='+dic_id, 
		function(data){
			
			$("#dicimg"+dic_id).attr('src',data);
			
		}
	);
	
}
