function isChar(wf)
{
	if (isFinite(wf))
	  return false;
	else
      	 return true;
}
function isNumeric(a)
{
	if (isNaN(a))
	  return false;
	else
	  return true;
}

function isEmpty(s)
{
	var l=s.length
	var i
	for(i=0;i<l;i++)
	  if (s.charAt(i)==" ")
	    return false;
	   else
	    return true;
}

function checkData(){
	var s;
	s=document.frmtxt.searchtxt.value;
	if (!(isEmpty(document.frmtxt.searchtxt.value))){
		alert("أدخل معلومات البحث");
		document.frmtxt.searchtxt.focus();
		return false;
	}	
	window.location.href="search_text.jsp?searchtxt="+s;	
}

function checkDataIndex(){
	var s;
	s=document.frmtxtindex.searchtxtindex.value;
	if (!(isEmpty(s))){
		alert("أدخل معلومات البحث");
		document.frmtxtindex.searchtxtindex.focus();
		return false;
	}	
	window.location.href="search_index.jsp?searchtxt="+s;	
}

function checkAll(){
	if (!(isEmpty(document.frmno.year.value))){
		alert("أدخل معلومات البحث");
		document.frmno.year.focus();
		return false;
	}
	else if (!(isNumeric(document.frmno.year.value))){
		alert("أدخل رقم من فضلك");
		document.frmno.year.focus();
		return false;
	}		
	frmno.submit();	
}

function checkAll1(){	
	if (!(isEmpty(document.frmno.no.value))){
		alert("أدخل معلومات البحث");
		document.frmno.no.focus();
		return false;
	}
	else if (!(isNumeric(document.frmno.no.value))){
		alert("أدخل رقم من فضلك في خانة رقم التشريع");
		document.frmno.no.focus();
		return false;
	} 	
	frmno.submit();	
}



function checkText(ss)
{
	k=event.keyCode;
	if ((k==13) || (k==10))
	{
	if (!(isEmpty(ss.value))){
		alert("أدخل معلومات البحث");
		ss.focus();
		return false;
	}
	window.location.href="search_text.jsp?searchtxt="+ss.value;	
	}
}
function checkTextIndex(ss)
{
	k=event.keyCode;
	if ((k==13) || (k==10))
	{
	if (!(isEmpty(ss.value))){
		alert("أدخل معلومات البحث");
		ss.focus();
		return false;
	}
	window.location.href="search_index.jsp?searchtxt="+ss.value;	
	}
}

function sendInfo_law(a,b,c)
{
	if (c==-1)
	return false;
	else
	window.location.href="../laws/searchno_article.jsp?no="+a+"&year="+b+"&article_no="+c+"#article";	
}

function sendInfo_bylaw(a,b,c)
{
	if (c==-1)
	return false;
	else
	window.location.href="../bylaws/searchno_article.jsp?no="+a+"&year="+b+"&article_no="+c+"#article";	
}


function sendInfo1(a,b,c,d)
{
	if (c==-1)
	return false;
	else
	window.location.href="searchno_article.jsp?no="+a+"&year="+b+"&article_no="+c+"&searchtxt="+d.value+"#article";	
}

function sendInfo_con(a,b)
{
	if (b==-1)
	return false;
	else
	window.location.href="../constitution/searchno_article.jsp?year="+a+"&article_no="+b+"#article";	
}

function sendInfo_contract(a,b,c)
{
	if (c==-1)
	return false;
	else
	window.location.href="../contracts/searchno_article.jsp?no="+a+"&year="+b+"&article_no="+c+"#article";	
}


function checkChar(chara)
{
//alert(chara.value);
//alert(chara)
	window.location.href="../laws/search_character.jsp?char="+chara;	
//	window.location.href="../laws/search_character.jsp?char=س";	

}