$(document).ready(function () {
	$("#btSearch").click(function(){
		var keywords = $("#tbKeywords");
		if(keywords.val() == ''){
			keywords.css({'border':'2px solid #FA997C'});
			alert('Enter Keywords to Search for.')
			return false;
		}else{
			keywords.css({'border':''});
			return true;
		}
	});
});

function mypopup(myURL,height,width) 
{
	var mywindow = window.open(myURL,"mywindow","location=0,status=0,scrollbars=1,width="+width+",height="+height+",top=50%,left=50%");
	mywindow.focus();
	var mywidth = screen.width;
	var myheight = screen.height;
	mywindow.moveTo(self.screen.width/10,self.screen.height/20);
 }
 
 function confirmation()
 {
 	if(confirm('Delete this records ?'))
 	{
 		return true;
 	}
 	else
 	{
 		return false;
 	}
 }

 function remove(id,id_user,id_topic,val){
	var dialog_box;
	switch(val){
		case 'file':
		dialog = 'Are you sure you want to delete this file?';
		break;
		case 'topic':
		dialog = 'Are you sure you want to delete this message?';
		break;
	}
	if(confirm(dialog)){
	$.ajax({
		type: "POST",
		url: "/scholars/ajax/delete_topic.php",
		data: "id="+id+"&id_user="+id_user+"&id_topic="+id_topic,
		success: function(msg)
		{
			$("#hide_this_1_"+id).fadeOut('fast');
			$("#hide_this_2_"+id).fadeOut('fast');
			$("#hide_this_3_"+id).fadeOut('fast');
			$("#hide_this_1_"+id).focus();
		}
	});
	}else{
		return false;
	}
}

function sort(page,stype,keywords,val,id_page,search_id){
		location.href=page+stype+keywords+val+id_page+search_id;
}
 

	
		
