function csw_archive(csw){
	
	if(csw.numero.value==""){
		alert("المرجو إدخال رقم العدد");
		csw.numero.focus();
		return false;
		}
		
	numero = csw.numero.value ;

	get_numero(numero);	
	
	return false;
	
	}
	
function file(fichier) {
if(window.XMLHttpRequest)
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject)
xhr_object = new ActiveXObject("Microsoft.XMLHTTP" );
else
return(false);
xhr_object.open("GET", fichier, false);
xhr_object.send(null);

if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}

function get_numero(id){
	
	rep = file("/ajax/archive.php?numero="+id);
	
	if(rep == "200"){
		location.href="http://almountakhab.com/numero.php?id="+numero+"";
	}
	
	if (rep.match(/CSWAM/) != null ){
		location.href="numero.php?id="+id+"";
	}
	
	if(rep == "404") {
		alert("العدد الذي طلبتم غير متوفر");
	}
}

function voter(id){

lenchoix = document.sondagediv.choix.length ;

verifcheck = false ;

for(i = 0; i < lenchoix ;i++){
	
	if(document.sondagediv.choix[i].checked == true){
		choix = document.sondagediv.choix[i].value ;
		verifcheck = true ;
		}
	
	}

if(verifcheck == false){
	alert("المرجو تحديد إختياركم");
	return false;
	}	

	
rep = file("/ajax/vote.php?id="+id+"&choix="+choix);

if(rep == "404"){
	alert("هذا الإستفتاء غير موجود");
	}
	
if(rep == "200"){
	alert("شكرا على التصويت");
	location.href="/";
	}
	
if(rep == "403"){
	alert("عذرا\nلا يمكنك التصويت عدة مرات");
	return false;
	}

	return false;
	
}

function voter_asad(id){

lenchoix = document.sondage_asad.choix.length ;

verifcheck = false ;

for(i = 0; i < lenchoix ;i++){
	
	if(document.sondage_asad.choix[i].checked == true){
		choix = document.sondage_asad.choix[i].value ;
		verifcheck = true ;
		}
	
	}

if(verifcheck == false){
	alert("المرجو تحديد إختياركم");
	return false;
	}	

	
rep = file("/ajax/vote.php?id="+id+"&choix="+choix);

if(rep == "404"){
	alert("هذا الإستفتاء غير موجود");
	}
	
if(rep == "200"){
	alert("شكرا على التصويت");
	location.href="/";
	}
	
if(rep == "403"){
	alert("عذرا\nلا يمكنك التصويت عدة مرات");
	return false;
	}

	return false;
	
}

function voter1(id){

lenchoix = document.sondagediv1.choix.length ;

verifcheck = false ;

for(i = 0; i < lenchoix ;i++){
	
	if(document.sondagediv1.choix[i].checked == true){
		choix = document.sondagediv1.choix[i].value ;
		verifcheck = true ;
		}
	
	}

if(verifcheck == false){
	alert("المرجو تحديد إختياركم");
	return false;
	}	

	
rep = file("/ajax/vote.php?id="+id+"&choix="+choix);

if(rep == "404"){
	alert("هذا الإستفتاء غير موجود");
	}
	
if(rep == "200"){
	alert("شكرا على التصويت");
	location.href="/";
	}
	
if(rep == "403"){
	alert("عذرا\nلا يمكنك التصويت عدة مرات");
	return false;
	}

	return false;
	
}
