function checkForm(form)
{
var validated = true;
if(form.username.value == "")
{
validated = false;
alert("أدخل إسم المستخدم");
form.username.focus();
}
else if(form.password.value == "")
{
validated = false;
alert("أدخل كلمة المرور");
form.password.focus();
}
else validated=true;

return validated;
}

function getError()
{ 
srch = location.search;
if(srch .substring(srch.search('gawaberr=1')))
alert('Invalid Login, Please check your user name and password');
}


function mota(x)

{var follow=x
if (document.all){

	curscroll.style.visibility="visible"
	curscroll.innerHTML='<table ID=\"sample\" border=0 cellspacing=1 bgcolor=black width=150 dir=rtl class=table ><tr><td width=100% bgcolor=#f1f1f1>' + x + '</td></tr></table>'
	document.all.sample.style.filter = 'alpha(opacity=80);'
}
curscroll.style.left=document.body.scrollLeft+event.clientX-0
curscroll.style.top=document.body.scrollTop+event.clientY+0
}

function tatmota(){
	curscroll.style.visibility="hidden"
}

function openTarget (form, features, windowName) {
  if (!windowName)
    windowName = 'formTarget' + (new Date().getTime());
  form.target = windowName;
  open ('', windowName, features);
}

var nbSearch=0;

function findInPage(str) {
  var txt, i, found;
  if (str=="") return false;

  if ((document.layers)||(window.sidebar)) {
    if (!window.find(str)) {
	 alert("نتيجة البحث :\n"+'"'+str+'" وجدت '+nbSearch+" مرة.");
	  while(window.find(str, false, true)) {nbSearch++;}
	} 
    else
      nbSearch++;
    if (nbSearch == 0)
      alert('"'+str+'" est introuvable');
  }

  if (document.all) {
    txt = window.document.body.createTextRange();
    for (i = 0; i <= nbSearch && (found = txt.findText(str)) != false; i++) {
      txt.moveStart("character", 1);
      txt.moveEnd("textedit");
    }
    if (found) {
      txt.moveStart("character", -1);
      txt.findText(str);
      txt.select();
      txt.scrollIntoView();
      nbSearch++;
    } else {
      if (nbSearch > 0) {
	  	  alert("نتيجة البحث :\n"+'"'+str+'" وجدت '+nbSearch+" مرة.");

        nbSearch = 0;
        findInPage(str);
      } else { 
	    alert('"'+str+'" غير موجودة');
	  }
    }
  }

  return false;
}

function icon(theicon) {
document.input.value.value +=  '' + theicon + '';
document.input.value.focus();
}
function smile(ye) {
document.input.value.value +=  '' + ye + '';
document.input.value.focus();
}

var req;

function loadajax(methode,url,cmdz) {

   	req = false;
       if(window.XMLHttpRequest) {
    	try {
	req = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
      } else if(window.ActiveXObject) {
       	try {
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }
	if(req) {
		req.onreadystatechange = processReqChange;
		req.open(methode,url ,true);
		req.send(cmdz);
	}
}
function processReqChange()
{
if(req.readyState == 1){
        document.getElementById('zoneshow').innerHTML = 'جاري جلب البيانات...';
    }
 if (req.readyState == 4)
 { 
   if (req.status == 200)
    {
       var result_ = req.responseText;
      document.getElementById('zoneshow').innerHTML = result_;
      }
      else
      {
   alert("خطأ في جلب البيانات: " + req.statusText);

   }
} 

return true; 
}



              var myHeight = 150;
              var isResizable = false;
              function createTarget(form) {
               _target = form.target;
               _colon = _target.indexOf(":");
               if(_colon != -1) {
                 form.target = _target.substring(0,_colon);
                 form.args = _target.substring(_colon+1);
               } else if(typeof(form.args)=="undefined") {
                form.args = "";
               }
               if(form.args.indexOf("{")!=-1) {
                _args = form.args.split("{");
                form.args = _args[0];
                for(var i = 1; i < _args.length;i++) {
                 _args[i] = _args[i].split("}");
                 form.args += eval(_args[i][0]) + _args[i][1];
                }
               }
               form.args = form.args.replace(/ /g,"");
                _win = window.open('',form.target,form.args);
               if(typeof(focus)=="function")
                _win.focus();
                return true;
               }
var bookmarkurl="http://www.the-soft.net"
var bookmarktitle="بوابة ذي سوفت - بوابتك الأولى على الأنترنت"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
            
function vote(result) {
window.open(result, '', 'width=170,height=300, scrollbars=no');
}       
function album(result) {
window.open(result, '', 'width=427,height=263, scrollbars=no');
}           
         
function affich(theURL) {
window.open(theURL, '', 'width=800,height=600, scrollbars=no');
}
function hotel(theURL) {
window.open(theURL, '', 'width=560,height=650, scrollbars=yes');
}
function newz(theURL) {
window.open(theURL, '', 'width=500,height=355, scrollbars=no');
}
function print(theURL) {
window.open(theURL, '', 'width=500,height=600, scrollbars=yes');
}
function lessvote(theURL) {
window.open(theURL, '', 'width=300,height=100, scrollbars=no');
}
function send(theURL) {
window.open(theURL, '', 'width=550,height=400, scrollbars=no');
}
function comment(theURL) {
window.open(theURL, '', 'width=450,height=450, scrollbars=yes');
}
function tahmil(theURL) {
window.open(theURL, '', 'width=320,height=130, scrollbars=no');
}
function karikatur(theURL) {
window.open(theURL, '', 'width=<? echo $width; ?>,height=<? echo $height; ?>, scrollbars=no');
}
 function karik(karukature,w,h) {
                window.open(karukature, "THESOFT", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width="+w+",height="+h+"")
        }
function games(game,w,h) {
                window.open(game, "THESOFT", "toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=auto,resizable=no,width="+w+",height="+h+"")
        }
function fastpanel(dasofts)
	{
	location.href = "?go=members&action=panel&id="+dasofts.fpanel.options[dasofts.fpanel.selectedIndex].value+"&ses="+dasofts.dasession.value+"";
	}
function fastkar(thesoft)
	{
	location.href = "?go=karikatur&action=cat&id="+thesoft.cat.options[thesoft.cat.selectedIndex].value+"&ses="+thesoft.dasession2.value+"";
	}


function fastclass(classfied)
	{
	location.href = "?go=class&action=cat&id="+classfied.subcat.options[classfied.subcat.selectedIndex].value+"&ses="+classfied.dasession1.value+"";
	}
