/**

*heightWindow  جلب ارتفاع الصفحة

* @return int

*/



var  heightWindow=function(){

	var h=0;

	if(window.inneerWidth){

		h=parseInt(window.inneerHeight);

	}

	else if((document.body) &&(document.body.clientHeight)){

		h=parseInt(document.body.clientHeight);

	}

	else if((document.documentElement) &&(document.documentElement.clientHeight)){

		h=(parseInt(document.documentElement.clientHeight)+(document.documentElement.scrollHeight));

	}

	return h;

};

/**

*widthWindow  جلب عرض الصفحة كاملة

* @return int

*/



var widthWindow=function(){

	var h=0;

	if(window.inneerWidth){

		h=parseInt(window.inneerWidth);

	}

	else if((document.body) &&(document.body.clientWidth)){

		h=parseInt(document.body.clientWidth);

	}

	else if((document.documentElement) &&(document.documentElement.clientWidth)){

		h=(parseInt(document.documentElement.clientWidth)+(document.documentElement.scrollWidth));

	}

	return h;

};




/**

* $ function الحصول على مقبض العنصر

* @param 1 :string

*	@return 1:handel

*/

var vildate=function(){

	var returns =true;

	for(var k in arguments[1]){
		if(BK.prototype.id(arguments[0])[arguments[1][k]].value=='' ||BK.prototype.id(arguments[0])[arguments[1][k]].value==null){
			var bar=BK.prototype.id(arguments[0])[arguments[1][k]].parentNode;
			if(bar.getElementsByTagName('img')[0]!=undefined){
				bar.removeChild(bar.getElementsByTagName('img')[0]);
			}

			if(bar.getElementsByTagName('img')[0]==undefined){
				var img=new Image();
				img.className='err';
				img.title='لقد تركت الحقل فارغ';
				img.src='images/wrong.gif';
				bar.appendChild(img);

			}

			returns =false;

		}

		else if(BK.prototype.id(arguments[0])[arguments[1][k]].value!='' ||BK.prototype.id(arguments[0])[arguments[1][k]].value!=null){

			var bar=BK.prototype.id(arguments[0])[arguments[1][k]].parentNode;

			if(bar.getElementsByTagName('img')[0]!=undefined){
				bar.removeChild(bar.getElementsByTagName('img')[0]);
			}
			if(bar.getElementsByTagName('img')[0]==undefined){

				var img=new Image();

				img.className='ok';

				img.title='';

				img.src='images/correct.gif';

				bar.appendChild(img);

			}
		}

	}

	return returns;

};




var conectus=function(){

	if(BK.prototype.id('conectus').style.display=='block'){

		$('conectus').hide();

	}
	else {

		$('conectus').show();

		BK.prototype.id('conectus').style.height=heightWindow()+'px';

		BK.prototype.id('conectus').style.width=widthWindow()+'px';

		//changeOpacity(90,'conectus');

		BK.Ajax.Updates('html/conectus.php','conectus');

	}
};





///////////////////////////////////////////



var showConectus_img=function(src){
	$('conectus').show();
	document.getElementById('conectus').style['height']=heightWindow()+'px';
	document.getElementById('conectus').style['width']=widthWindow()+'px';
	document.getElementById('conectus').innerHTML='<div id="formConectus" style="width:10px;margin:auto;"><img  style="cursor:pointer" alt="" src="images/close.png" style="left:15px ;top:15px;position: relative; float: right"  onclick="$(\'conectus\').hide();"><div id="formConectusshdow"></div></div>';
	var img=new Image();
	img.src=src;
	document.getElementById('formConectus').appendChild(img);
	img.onmouseover=function(){
	};
}