// JavaScript Document
      $(document).ready(function() {
   			

      });


function article_image_dimensions(article_img){
	var img = document.getElementById(article_img); 
	var width = img.clientWidth;
	var height = img.clientHeight;
	//alert("width= " + width + " height "+ height);
}

function search_phrase(phrase){
	//alert(phrase);	
	$("#search_result_area").attr('display', 'none').hide("slow");
	$("#search_results_list").html("");
	var search_data = $("#search_form").serialize()+"&lang="+$("#lang_code").val();
	
	$.ajax({  
	         url: "includes/search/search_res.php",    
	         type: "POST", 
			 data: search_data,         
	         cache: false,  
	         success: function (results) {
				 $("#search_result_area").attr('display', 'block').show("slow");
				 $("#search_results_list").html(results);
			 },
			 error: function(){
 	          	alert('Error loading document: ');
     	    }
	  	}); 
}

function numericInput(inputID){
$('#'+inputID).bind('keydown', function(e) {//$('input.numOnly').bind('keypress', function(e) {
//var key_code = (e.keyCode ? e.keyCode : e.which);
var key_code = e.keyCode || e.which;
//alert(key_code);
if(key_code == 8){
	return true;
}
if(key_code == 35){
	return true;
}
if(key_code == 36){
	return true;
}
if(key_code == 37){
	return true;
}
if(key_code == 39){
	return true;
}
if(key_code == 46){
	return true;
}
if(key_code == 190){
	var str = $('#'+inputID).val();
	var strSplit = str.split(".");
	if(!strSplit[1]){
		if(strSplit[1] != ""){
				return true;
			}
		
	}
}	
if (key_code >= 48 && key_code <= 58){
	//alert(key_code);
	//e.preventDefault();
	//e.stopPropagation( );  
    //e.preventDefault( );
	return true;
}
e.stopPropagation( );  
    e.preventDefault( );
	return false;
});
}


