﻿var ii;
var selectedId;
ii=1;
selectedId=0;

var the_timeout;
var o;
o=1;
var new_height;
var theDirection;
var theAlign;
var capDraw = false;

var secs = 2;
var timerID = null;
var timerRunning = false;
var slideIsMoving = false;

var imgArr = new Array();
var imgCapArr = new Array();
var imgHirArr = new Array();
var imgTitle = new Array();

var browser = new Object();
browser.isNavigator = false;
browser.isIE = false;
browser.isIE8 = false;
browser.isIE6 = false;

var imageIsLoaded = false;


var thumbDiv;

var divMain;
var divMainContainer;
var divP;
var dimage;
var flashVideo;
var imgcls;
var thumb;
var fshHeader;
var arrowN;
var arrowP;
var divCap;
var divCapTxt;
var titleTble;
var i; 
var thumbs;
var Tdir;
var rAlign;
var dico;
var dcls;
var thumb;
var mainImg;
var step;
var diconeTitle;
var imgDimSize=750;
var selectedImage=0;
step = 0;

var flashplayer="";
var layerType="";

 var imageInst; 
 var alreadyBlended=false;
 var mouseOverCaption=false;
 var mouseOverCaptionTxt=false;
 

if (navigator.appName.indexOf("Netscape") != -1) 
    browser.isNavigator = true;
else if (navigator.userAgent.indexOf("MSIE 8") != -1){
    browser.isIE = true;
	browser.isIE8 = true;
}else if(navigator.userAgent.indexOf("MSIE 6") != -1){
	browser.isIE = true;
	browser.isIE8 = false;
	browser.isIE7 = false;
	browser.isIE6 = true;
	
	
	}else{
		
	browser.isIE = true;
	browser.isIE8 = false;
	browser.isIE7 = true;
	browser.isIE6 = false;
		
		
		}
	
function $(id) {
	return document.getElementById(id);
}



function loadImage(imgObj){
	iTry=0;
	//$("loadProg").style.width= 1;
	//$("loadProg").innerHTML = iTry + "%";
	dimage=new Image();
	dimage.src = imgObj.src;
	checkImgLoaded();
	
}//
var ooo;
ooo= 0;
var tID="";
var iTry=0;

function checkImgLoaded(){
 
if (dimage.complete){
		//$("loadProg").style.width = 100;
		//$("loadProg").innerHTML = (10*10) + "%";
		window.clearInterval(tID); 
		imageIsLoaded = true;
		ooo++;
		imgDimSize= dimage.width;
		setTitleWidths(dimage);
		$("previewImg").src="";
		
		readyToAppear(0,'','',dimage.src,'','','');
		
		

	}else{
$("previewImg").style.visibility='hidden';
		iTry++;
		
		if (iTry>120){
			window.clearInterval(tID); 
		}else{
			/*
			if (iTry >= 10){ 
				$("loadProg").style.width = 10* 10;
				$("loadProg").innerHTML = (10*10) + "%";
			}else{
				$("loadProg").style.width = iTry* 10;
				$("loadProg").innerHTML = (iTry*10) + "%";
				}
				*/
		
			tID = window.setTimeout('checkImgLoaded()',750);	
			
		}

	}
	
}//




window.onresize = function(){
		setDivMainContainerPlace(document.body.clientWidth);
}



function setDivMainContainerPlace(browserWidth){
		
try{

if(browser.isIE){
			
			if(layerType=='v'){
			
			//$("subDiv").style.left=  eval((browserWidth / 2) - 300);
			
			}else{
			
			$('captionDiv').style.left=	$('imgDiv').offsetLeft + 4 + "px";
			$('captionDivTxt').style.left=	$('imgDiv').offsetLeft + 4 + "px";
			var x;
			x =parseInt($('imgDiv').offsetLeft) + parseInt($("imgDiv").style.width);
			
			$("thumbDiv").style.height='528px';
			$("thumbDiv").style.left=1;
			$("thumbDiv").style.left=x +"px";

				
				}
			
		}else{
			if(layerType=='v'){
				//$("subDiv").style.left=  eval((browserWidth / 2) - 215) + 'px';
				
				
			}else{

		
			
			$('captionDiv').style.left=	$("imgDiv").offsetLeft + 3 + "px";
			$('captionDivTxt').style.left=	$("imgDiv").offsetLeft + 3 + "px";
		
		
		var x;
		x =parseInt($('imgDiv').offsetLeft) + parseInt($("imgDiv").style.width);
			//alert(x);
	
		$("thumbDiv").style.height='528px';
		$("thumbDiv").style.left=x +"px";

				//$("subDiv").style.width=document.body.clientWidth + 'px';
			}
		}



}

catch (err){
		//alert(err.description);
		
		}//Try

}//



function openNewDiv(photoId,srcPath,IDlist,photo,thumbnail,photoDesc,photoDate){
	 	selectedImage=photoId;
		
		
		if (imgArr.length > 1) {
			inetialSelectedImage(photoId);
		}
		
		$("previewVideo").innerHTML="";
		 $("flashHeader").style.visibility="hidden";
		
		layerType='i';
		


	
	if (browser.isIE6){
		$("previewMainDiv").style.position="absolute";
		$("previewMainDiv").style.height  = document.body.clientHeight;
		}else{
		$("previewMainDiv").style.position="fixed";
		$("previewMainDiv").style.height  = '100%';
		}




		$("previewMainDiv").style.visibility="visible";
    	
		
		if (alreadyBlended) {
			
			}else{
			blendDivs('previewMainDiv',90,85);				
				}

		
		alreadyBlended=true;
		var inetialImage;
		inetialImage = new Image();
		inetialImage.src=photo;
		loadImage(inetialImage);
		
		
}//

function openNewVideoDiv(videoPath,intialImage,vTitle,vCaption){
	    layerType='v';
		flashplayer="";
		$("flashHeader").style.visibility="hidden";
		
		$("previewMainDiv").style.visibility="visible";
    	blendDivs('previewMainDiv',90,90);
    	
		try {
			$('captionDiv').style.width = 1;
			$('captionDivTxt').style.width = 1;
			$("previewImg").width=1;			
		   			$("subDiv").style.visibility="visible";
					$("imgDiv").style.visibility="hidden";
					$("thumbDiv").style.visibility="hidden";
					
					$("iconAreaIV").src="../img/videoIcon.png";
					
					
    		flashVideo  = $("previewVideo");
		
			//$("previewMainDiv").style.height  = '100%';
			//$("previewMainDiv").style.height=document.body.scrollHeight + "px";
			
			
				if (browser.isIE6){
					$("previewMainDiv").style.position="absolute";
					$("previewMainDiv").style.height  = document.body.clientHeight;
				}else{
					$("previewMainDiv").style.position="fixed";
					$("previewMainDiv").style.height  = '100%';
				}
			
			
			
			setTitleWidthsForVideo(flashVideo);
			generateTitle('v',vTitle);
			flashVideo.style.visibility="visible"; 
			flashplayer='';
			flashplayer= '<embed flashvars=\"';
			flashplayer += ' &amp;displayheight=320&amp;file=' + videoPath ;
			flashplayer += '&amp;height=320&amp;width=430&amp;autostart=false';
			flashplayer += '&amp;image=' + intialImage + '\"';
			flashplayer+= ' allowscriptaccess="always" allowfullscreen="true" height="320" width="430" src="flvplayer.swf"> \r\n';
			flashplayer +='  </embed>';
			flashVideo.innerHTML=flashplayer;
			
	
	   	
}catch (err){
		//alert(err.description);
		
		}//Try

    	
    	
}//





function openNewLiveVideoDiv(videoPath,intialImage,vTitle,vCaption, videoLive){
	    layerType='v';
		flashplayer="";
		$("flashHeader").style.visibility="hidden";
		$("previewMainDiv").style.visibility="visible";
		$("liveH").style.visibility="hidden";
    	//blendDivs('previewMainDiv',90,90);
    	
		try {
			$('captionDiv').style.width = 1;
			$('captionDivTxt').style.width = 1;
			$("previewImg").width=1;			
		   			$("subDiv").style.visibility="visible";
					$("imgDiv").style.visibility="hidden";
					$("thumbDiv").style.visibility="hidden";
					
					$("iconAreaIV").src="../img/videoIcon.png";
					
					
    		flashVideo  = $("previewVideo");
		
			if (browser.isIE6){
					$("previewMainDiv").style.position="absolute";
					$("previewMainDiv").style.height  = document.body.clientHeight;
				}else{
					$("previewMainDiv").style.position="fixed";
					$("previewMainDiv").style.height  = '100%';
				}
			
			

			//$("previewMainDiv").style.height  = '100%';
			setTitleWidthsForVideo(flashVideo);
		  	generateTitle('v',vTitle);
			flashVideo.style.visibility="visible"; 
			

			
			flashplayer='';
			if (videoPath=='') {
				videoPath='http://www.sheikhmohammed.ae/video/arabic/2010/2010-08-12_SM_01_NE_08_12_2010_00_06_18.flv';
				}
			
			if (videoLive) {
			flashplayer='';
			flashplayer= '<embed src=\"flvplayer.swf\" width=\"480\" height=\"282\" allowfullscreen=\"true\" allowscriptaccess=\"always\"';
			flashplayer += 'flashvars=\"&amp;displayheight=348&amp;file=rtmpt://213.132.58.244/broadcast&broadcast&amp;image=' + intialImage + '&amp;height=282&amp;width=480&amp;id=stream1"" />   \r\n';
			flashplayer +='  </embed>';
			}else{
				
			




flashplayer='';
		


			


   





	flashplayer='<div style=" font-weight:bold; text-align:justify; font-size:14;  font-family:arial;  color:#ffffff; width:650px;  ">';
			flashplayer +='   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  طرح صاحب السمو الشيخ محمد بن راشد آل مكتوم، نائب رئيس الدولة رئيس مجلس الوزراء حاكم دبي، رعاه الله، اعتباراً من اليوم الأول في شهر رمضان المبارك للعام الهجري 1431 هـ، 2010 ميلادي خواطر رمضانية تهدف إلى تنشيط أوقات الصائمين وإثراء معلوماتهم في الجوانب التاريخية والدينية، وتم إعداد هذه الخواطر في صورة أبيات شعرية يسهل تداولها بين كل شرائح المجتمع، وتطرح في الوقت نفسه أسئلة تتعلق بشؤون تهم كل صائم ويمكن الإجابة عنها بأي طريقة كانت، نظماً أم نثراً من خلال التواصل مع مؤسسة دبي للإعلام التي تتولى عملية بث ونشر الخواطر عبر كافة قنواتها التلفزيونية والصحف التابعة لها بشكل يومي على مدى عشرين يوماً من شهر رمضان المبارك، وقد أمر صاحب السمو الشيخ محمد بن راشد آل مكتوم بتكريم أصحاب الإجابات الصحيحة بنهاية شهر رمضان المبارك ';
			flashplayer +='<br/><br/></div>';
			


			



			flashplayer += '<hr    color=\"#ffcd67\" size=\"1px\" ><div style=\" text-align:center;\"><embed type=\"application/x-shockwave-flash\" src=\"flvplayer.swf\" width=\"430\" height=\"320\" allowfullscreen=\"true\" allowscriptaccess=\"always\"';
			flashplayer += 'flashvars=\"&amp;displayheight=320&amp;file='+ videoPath +'&amp;image=' + intialImage + '&amp;height=320&amp;width=430&amp;id=stream1"" />   \r\n';
			flashplayer +='  </embed></div>';	
			
			var table;
				table = "<div class=\"khawaterThums\"><table  border=0 width='350px'><tr>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s1a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/2010-08-12_SM_01_NE_08_12_2010_00_06_18.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s2a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/2010-08-12_SM_KHAWATER_02_21_30_43.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s3a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/2010-08-13_KHAWATER_03_18_52_44.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s4a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_04.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s5a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_05.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s6a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_06.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s7a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_07.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s8a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_08.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s9a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_09.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s10a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_10.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "</tr><tr>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s11a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_11.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s12a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_12.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s13a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_13.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s14a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_14.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s15a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_15.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s16a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_16.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s17a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_17.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s18a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_18.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s19a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_19.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "<td><ul><li class=\"vidImg\"><img src=\"http://www.sheikhmohammed.ae/StaticFiles/Video%20Thumbnails/Aug-12-s20a.jpg\" height=\"45\" width=\"54\" onclick=\"openNewLiveVideoDiv(\'http://www.sheikhmohammed.ae/video/arabic/2010/khawater2010_20.flv\',\'http://www.sheikhmohammed.ae/vgn-ext-templating/img/Khawater2010video.jpg\',\'\',\'\');\"  style=\"cursor:hand; cursor:pointer\"/></li></ul></td>"
				table += "</tr></table></div><hr   color=\"#ffcd67\"  size=\"1px\">"
				
				flashplayer += table; 
				}
			 //flashplayer ='<img  alt=""   src="' + intialImage + '" />';
			
			flashVideo.innerHTML=flashplayer;
			
	
	   	
}catch (err){
		//alert(err.description);
		
		}//Try

    	
    	
}//






function openNewFLASHDiv(Lang,FlashPath,vTitle,vCaption,width,height){
	    layerType='v';
		flashplayer="";
		$("flashHeader").style.visibility="hidden";
		
		if ($("FlashTabAr") != null){
			$("FlashTabAr").style.visibility="hidden";			
			}

		
		$("previewMainDiv").style.visibility="visible";
    	blendDivs('previewMainDiv',90,90);
    	
		try {
			$('captionDiv').style.width = 1;
			$('captionDivTxt').style.width = 1;
			$("previewImg").width=1;			
		   			$("subDiv").style.visibility="visible";
					$("imgDiv").style.visibility="hidden";
					$("thumbDiv").style.visibility="hidden";
					
					//$("iconAreaIV").src="../img/videoIcon.png";
					
					
    		flashVideo  = $("previewVideo");
		


			
				if (browser.isIE6){
					$("previewMainDiv").style.position="absolute";
					$("previewMainDiv").style.height  = document.body.clientHeight;
				}else{
					$("previewMainDiv").style.position="fixed";
					$("previewMainDiv").style.height  = '100%';
				}
			
			

			//$("previewMainDiv").style.height  = '100%';
			setTitleWidthsForVideo(flashVideo);
		  	generateTitle('v',vTitle);
			flashVideo.style.visibility="visible"; 
			

			
						flashplayer='';
	var arab;
	if (direction=='rtl'){
		arab="/ar/";
	}else{
		arab="/4th-jan-eng/"
	}
	
	

flashplayer= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/sw flash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">';
flashplayer += '<param name="allowScriptAccess" value="sameDomain" />';
flashplayer += '<param name="movie" value="' + FlashPath + '" />';
flashplayer += '<embed src="' + FlashPath + '"' ;
flashplayer += 'width="' + width + '" height="' + height + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
flashplayer += '</object> ';

/*
flashplayer= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/sw flash.cab#version=8,0,0,0" width="875" height="720">';
flashplayer += '<param name="allowScriptAccess" value="sameDomain" />';
flashplayer += '<param name="movie" value="http://www.sheikhmohammed.ae/StaticFiles/flash/4thANN' + arab + '4thjan-6thjan.swf" />';
flashplayer += '<embed src="http://www.sheikhmohammed.ae/StaticFiles/flash/4thANN' + arab + '4thjan-6thjan.swf"' ;
flashplayer += 'width="875" height="720" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
flashplayer += '</object> ';
*/
/*
flashplayer= '<OBJECT HEIGHT=\"720\" WIDTH=\"875\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"';

flashplayer += 'classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><PARAM VALUE=\"/staticfiles/flash/4thANN/4th-jan-eng/4thjan.swf\" NAME=\"movie\">';
flashplayer += '<param value=\"always\" name=\"allowScriptAccess\">';
flashplayer += '<embed type=\"application/x-shockwave-flash\" ';
flashplayer += 'pluginspage=\"http://www.macromedia.com/go/getflashplayer\" height=\"720\" width=\"875\" src=\"/staticfiles/flash/4thANN/4th-jan-eng/4thjan.swf\">';
flashplayer += '</embed></OBJECT>';
*/
//alert(flashVideo + " " + flashplayer);
flashVideo.innerHTML=flashplayer;
			
	
	   	
}catch (err){
		//alert(err.description);
		
		}//Try

    	
    	
}//









function readyToAppear(photoId,srcPath,IDlist,photo,thumbnail,photoDesc,photoDate){
	
		try {
		
	   
		$("iconAreaIV").src="../img/imgIcon.png";
	   
    	 $("previewImg").src=dimage.src;
		 $("previewImg").width=dimage.width;
		 $("thumbDiv").style.width="40px";
		
		$("subDiv").style.visibility="visible";
		$("imgDiv").style.visibility="visible";
	  	$("previewImg").style.visibility="visible"; 
		
		$("thumbDiv").style.visibility="visible";
		$("thumbDiv").style.opacity = 0; 
    	$("thumbDiv").style.MozOpacity = 0; 
	    $("thumbDiv").style.KhtmlOpacity = 0; 
    	$("thumbDiv").style.filter=  "alpha(opacity=0)"; 
		$("previewImg").style.visibility='visible';
		
		
		generateTitle('i');
		setCaptionWidthsAndLeft($("previewImg"));
		
		if (imgArr.length>1){

				
			if (imgArr.length>5){
			
			}else{
			}
			startDisplaySlidebar();
	
		}else
		{
		}
	}catch (err){
		//alert(err.description);
		
		}//Try

	}//



function setCaptionWidthsAndLeft(currImg) {
		divCap= $("captionDiv");
		divCapTxt=$("captionDivTxt");
	
	
 if(browser.isIE){
		$("imgDiv").style.width = currImg.width + 5 + "px";
		if(browser.isIE8){
			divCap.style.width =  eval(currImg.width - 8) + "px";
			divCap.style.left=	$('imgDiv').offsetLeft + 1 + "px";
		}else{
			divCap.style.width =  eval(currImg.width - 12) + "px";
			divCap.style.left=	$('imgDiv').offsetLeft + 4 + "px";

		}

		divCap.style.top=	 $('imgDiv').offsetTop + 478+ "px";
		divCapTxt.style.direction = 'rtl';
		divCapTxt.style.width=divCap.style.width;
		divCapTxt.style.left= $('imgDiv').offsetLeft + 4 + "px";
		divCapTxt.style.whiteSpace='normal';
		divCapTxt.style.top=  $('imgDiv').offsetTop + 478+ "px";
		
		$("thumbDiv").style.top =$('imgDiv').offsetTop + "px";
		var x;
		x =parseInt($('imgDiv').offsetLeft) + parseInt($("imgDiv").style.width);
		$("thumbDiv").style.height='528px';
		$("thumbDiv").style.left=x +"px";

		//$("thumbDiv").style.marginTop="50px";
		
		if (imgArr.length > 1){ 
			$("tbl").style.marginTop = 264 - ($("tbl").offsetHeight  / 2 ) ;
		}
		
		
		
	
	}else{
		
		$("imgDiv").style.width = currImg.width + 6 +  "px";
		divCap.style.width =  currImg.width - 10 + "px";
		divCap.style.left=currImg.offsetLeft + 3+ "px";
		divCap.style.top=currImg.offsetTop + 478 + "px";
		divCapTxt.style.direction = 'rtl';
		divCapTxt.style.width =  currImg.width - 7 + "px";
		divCapTxt.style.left=currImg.offsetLeft + 1 + "px";
		divCapTxt.style.top=divCap.style.top;
		$("thumbDiv").style.top =$('imgDiv').offsetTop + "px";
		var x;
		x =parseInt($('imgDiv').offsetLeft) + parseInt($("imgDiv").style.width);
		$("thumbDiv").style.height='528px';
		$("thumbDiv").style.left=x +"px";
		
		}
	
	


}//



function setTitleWidthsForVideo(){
	
		if(browser.isIE){
			if(direction=='rtl'){ // Arabic
						$("diconeTitle").width	=430 + "px";
						$("captionAreaHeader").width=50;
						$("RightTitleHeader").width=1;
				
			}else{ //English
						$("diconeTitle").width	=430 + "px";
						$("captionAreaHeader").width=120;
						$("RightTitleHeader").width=100;
						$("thumbDiv").style.width=1;
				}
		
		
		
		}else{ // Not IE
			if(direction=='rtl'){ // Arabic
						$("diconeTitle").width	=430 + "px";
						$("captionAreaHeader").width=50;
						$("RightTitleHeader").width=1;
						

			}else{ //English
						$("diconeTitle").width	=430 + "px";
						$("captionAreaHeader").width=120;
						$("RightTitleHeader").width=100;
						$("thumbDiv").style.width=1;
					
				}
		}
	
	
	
	
	}//

function setTitleWidths(currImg){
		
		if(browser.isIE){
			if(direction=='rtl'){ // Arabic
					if (layerType=='v'){ 
							$("captionAreaHeader").width=1;
					}else{
							$("captionAreaHeader").width=50;
							}
					
					if (imgArr.length > 1){
						$("diconeTitle").width	=currImg.width;
						$("captionAreaHeader").width=50;
						$("RightTitleHeader").width=1;
						
						$("iconArea").align='right';
					}else{
						$("diconeTitle").width	=currImg.width;
						$("captionAreaHeader").width=50;
						$("thumbDiv").style.width=1;
						}
				
			
			}else{ //English
			$("captionAreaHeader").width=1;
					if (imgArr.length > 1){
						$("diconeTitle").width	=currImg.width;
						$("captionAreaHeader").width=50;
						$("RightTitleHeader").width=1;
						
					}else{
						$("diconeTitle").width	=currImg.width;
						$("captionAreaHeader").width=50;
						$("thumbDiv").style.width=1;
						}
				}
		
		
		
		}else{ // Not IE
			
		
		
			if(direction=='rtl'){ // Arabic
						$("diconeTitle").width	=currImg.width;
						$("captionAreaHeader").width=120;
			
					if (imgArr.length > 1){
						$("iconArea").align='right';
						$("RightTitleHeader").width=1;
						$("captionAreaHeader").width=50;
					}else{
						$("iconArea").align='right';
						$("captionAreaHeader").width=50;
						$("thumbDiv").style.width=1;
						}
				
			
			}else{ //English

						$("diconeTitle").width	=currImg.width;
						$("captionAreaHeader").width=120;
			
					if (imgArr.length > 1){
						$("RightTitleHeader").width=1;
						$("captionAreaHeader").width=50;
					}else{
						$("RightTitleHeader").width=1;
						$("captionAreaHeader").width=50;
						$("thumbDiv").style.width=1;
						}
				}
		}
		
}//







function startDisplaySlidebar(){
		increaseDivHieght();
	}//



function generateCaptions (){
	if (imgArr.length > 1) {
		if (direction=='rtl') { //Arabic veriosn
			thumbs = '<div id=tbl dir=rtl  style="vertical-align:middle">';
			for (i=0;i<imgArr.length;i++)
				{
					if (i==imgArr.length-1){
						 thumbs = thumbs + '<p  class="gldarrowAr" align=center id="thumb_'+ i +'"  border="0" style="opacity:1;filter:alpha(opacity=90);cursor:hand; cursor:pointer" onclick="setImageAndCaption(' + i + ',this);"  onmouseover="apprThumbDiv(\''+ imgArr[i] +'\',this.id,event);" onmouseout="hideThumbDiv(this,' + i + ');">' + eval(i+1) + '</p></div>';
						}else{
						thumbs = thumbs + '<p  class="gldarrowAr" align=center id="thumb_'+ i +'"  border="0" style="opacity:1;filter:alpha(opacity=90);cursor:hand; cursor:pointer" onclick="setImageAndCaption(' + i + ',this);" onmouseover="apprThumbDiv(\''+ imgArr[i] +'\',this.id,event);" onmouseout="hideThumbDiv(this,' + i + ');">' + eval(i+1) + '</p>';
						}
	
				}document.write(thumbs);
		}else{ //English veriosn
			
			
			
			thumbs = '<div id=tbl dir=ltr style="vertical-align:middle">';
			for (i=0;i<imgArr.length;i++)
				{
					if (i==imgArr.length-1){
						  thumbs = thumbs + '<p  class="gldarrow" align=center id="thumb_'+ i +'"  border="0" style="opacity:1;filter:alpha(opacity=90);cursor:hand; cursor:pointer" onclick="setImageAndCaption(' + i + ',this);"  onmouseover="apprThumbDiv(\''+ imgArr[i] +'\',this.id,event);" onmouseout="hideThumbDiv(this,' + i + ');">' + eval(i+1) + '</p></div>';
						}else{
						thumbs = thumbs + '<p  class="gldarrow" align=center id="thumb_'+ i +'"  border="0" style="opacity:1;filter:alpha(opacity=90);cursor:hand; cursor:pointer" onclick="setImageAndCaption(' + i + ',this);" onmouseover="apprThumbDiv(\''+ imgArr[i] +'\',this.id,event);" onmouseout="hideThumbDiv(this,' + i + ');">' + eval(i+1) + '</p>';
						}
	
				}document.write(thumbs);
			
			
			}
		}
		
}//
	
function setImageAndCaption(i,thumb){
		
		selectedImage = i;
	    divCap= $("captionDiv");
	    divCapTxt= $("captionDivTxt");
		capDraw=false;
		divCap.innerHTML='';
		divCapTxt.innerHTML='';
		thumb.style.filter ='alpha(opacity=100);';
		openNewDiv(i,'','',imgHirArr[i]);
		divCapTxt.innerHTML='<h3>' +imgCapArr[i] + '</h3>';
	
		onFocFunc(thumb);
		resetOthers(thumb);
		
	}//
	
	
	function resetOthers(thumb){
		var k = 0;
		var testThumb="";
		
		for(k=0;k<imgCapArr.length;k++){
			testThumb = 'thumb_' + k
				if (thumb.id != testThumb){
					onBlurFunc($(testThumb));
				}else{
					onFocFunc($(testThumb));
				}
			}
	}//

	
	function onBlurFunc(thumb){
		thumb.style.filter ='alpha(opacity=100);';
		thumb.style.opacity='1';
		thumb.style.background='none';
		
	
	}//

	function onFocFunc(thumb){
		thumb.style.filter ='alpha(opacity=100);';
		thumb.style.opacity='1';
		thumb.style.backgroundImage="url(../img/bgonMouseOver.gif)";
	}//
	
function resetAll(){
		var k = 0;
		for(k=0;k<imgCapArr.length;k++){
					testThumb = 'thumb_' + k;
					onBlurFunc($(testThumb));
			}
	}//
	
	
	function inetialSelectedImage(i){
		var k = 0;
		var testThumb="";
			testThumb = 'thumb_' + i
					onFocFunc($(testThumb));
					
		
	}//
	
function getCaption(id,theEvent){
		
		var img;
		if (!capDraw){
			divCap= $("captionDiv");
			divCapTxt= $("captionDivTxt");
			img= $("previewImg");
		 	
			
			if(browser.isIE){
		
				if (imageIsLoaded){
					capDraw=true;
					divCapTxt.innerHTML='<h3>' +imgCapArr[selectedImage] + '</h3>';	   
					divCap.style.visibility="visible"; 
					divCapTxt.style.visibility="visible"; 
					blendDivs('captionDiv',90,50);

				}
			}else{
	
					if (imageIsLoaded){
						capDraw=true;
						divCapTxt.innerHTML='<h3>' +imgCapArr[selectedImage] + '</h3>';	   
						divCap.style.visibility="visible"; 
						divCapTxt.style.visibility="visible"; 
						blendDivs('captionDiv',90,50);
						
					}
				}
			
		}
		   
}//
		
function generateTitle(layerType,vTitle){
		var theTitle = "";
		if (layerType=='v') {
			theTitle =vTitle;
			$("diconeTitle").innerHTML="<b>" + theTitle + "</b>";
		}else{
			theTitle = imgTitle[0];
			$("diconeTitle").innerHTML="<b>" + theTitle + "</b>";
		}
}//
		
function see(theEvent){
			var sTop;
			//sTop=window.pageYOffset;
			sTop=document.documentElement.scrollTop;

//window.status = theEvent.clientY + " " + sTop + " T:" + eval(theEvent.clientY +  sTop);

	}
	
	
function hideCaption(id,theEvent){
			var sTop;
			if (browser.isIE){
			sTop=document.documentElement.scrollTop;
				if (theEvent.clientY>=eval(785-sTop) || theEvent.clientY<=eval(720-sTop) ){
					//alert(browser.isIE);
					capDraw=false;
				 	divCap= $("captionDiv");
					divCapTxt= $("captionDivTxt");
					divCap.style.visibility="hidden"; 
				    divCapTxt.style.visibility="hidden"; 
				}

			}else{ // Not IE
			sTop=window.pageYOffset;
			if (theEvent.clientY>=eval(765-sTop) || theEvent.clientY<=eval(709-sTop) ){
					capDraw=false;
				 	divCap= $("captionDiv");
					divCapTxt= $("captionDivTxt");
					divCap.style.visibility="hidden"; 
				    divCapTxt.style.visibility="hidden"; 
				}
			}

}//


function hideMainDiv(){

try{
		
	alreadyBlended=false;  
   	divP = $("subDiv");
   	dimage = $("previewImg");
   	divMain =$("previewMainDiv"); 
	thumbDiv = $("thumbDiv");
	divCap= $("captionDiv");
    divCapTxt= $("captionDivTxt");
   	fshHeader = $("flashHeader");
	flashVideo  = $("previewVideo");
   	divMain.style.visibility="hidden";
    divP.style.visibility="hidden";
   	dimage.style.visibility="hidden"; 
   	divCap.style.visibility="hidden"; 
   	divCapTxt.style.visibility="hidden"; 
	thumbDiv.style.visibility="hidden"; 
	$("imgDiv").style.visibility="hidden";
    fshHeader.style.visibility="visible";
	$("liveH").style.visibility="visible";

	$("previewVideo").style.visibility="hidden"; 
	capDraw=false;
	divCap.innerHTML=''; 
	flashVideo.innerHTML='';
	
	
	if ($("FlashTabAr") != null){
			$("FlashTabAr").style.visibility="visible";			
			}
	
  	document.body.style.overflow="";
	document.body.scroll = "yes";
	
	o=1;
	
	// this fucntion to remove the highlighted thumbnails...
	resetAll();

	} catch (err){
		//alert(err.description)
		}//Try


}//





    

function increaseDivHieght(){
   
	current_height = 650;
	new_height = current_height + 20 + 'px';
	if (document.layers) 
    {
    }
    else 
    {  
    }
    if (parseInt(new_height) < 650)
    {
      the_timeout = setTimeout('increaseDivHieght();',1);
    }else{
		shiftOpacity('thumbDiv',250);
	}
}//


function shiftOpacity(id, millisec) { 
  opacity(id, 0, 100, millisec); 
} //



function opacity(id, opacStart, opacEnd, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} //

function changeOpac(opacity, id) { 
    var object = $(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}// 


function blendimage(divid, imageid, imagefile, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    changeOpac(0, imageid); 
    $(imageid).src = imagefile; 
    for(i = 0; i <= 100; i++) { 
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++; 
    } 
}//


function blendDivs(divid, millisec, DarkDegree) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    changeOpac(0, divid); 
    for(i = 0; i <= DarkDegree; i++) { 
        setTimeout("changeOpac(" + i + ",'" + divid + "')",(timer * speed)); 
        timer++; 
    } 
	
}//


   
function setLangDirections(dir){


Tdir = $("imgTitle");
rAlign = $("rTitle");
dico = $("diconeTitle");
dcls =$("dclsTitle");
thumb = $("thumbDiv"); 


theDirection = dir;
Tdir.dir = dir;
if (dir=='ltr'){
    rAlign.align = 'left';
    dico.align =  rAlign.align;
    dcls.align ='right';
	thumb.style.direction=dir;
	
}else{
    rAlign.align = 'right';
    dico.align = rAlign.align;
    dcls.align = 'left';
	thumb.style.direction=dir;
    
}

}//



function apprThumbDiv(imgPath,pid,theEvent){
	var capDiv;
	var newThumb;
	var tX=0;
	var tY= 0;
	newThumb = $("sThumbDiv");
	capDiv = $("thumbDiv");
	
	
	newThumb.style.width=135 + 'px';
	newThumb.style.height=98 + 'px';
	
	
	if(browser.isIE){
			
			
			tX = event.clientX + document.body.scrollLeft;

			tX = $("thumbDiv").style.left ;
		
		
		
		if (browser.isIE6){
			$("sThumbDiv").style.position="absolute";
			tY = event.clientY + document.body.scrollTop ;
			tY = eval(tY - 125);
			

		}else{
			$("sThumbDiv").style.position  = "fixed";
			tY = event.clientY + document.body.scrollTop ;
			tY = eval(tY - 10);
			
		}
			
				
			
			
			
			
			newThumb.style.top= tY + 'px';
			newThumb.style.left= parseInt($('thumbDiv').style.left) - 145 + 'px';
			$(pid).style.background="background-image: url(../img/bgonMouseOver.gif) ";
			
			
	}else{ // Not IE
			tX = theEvent.clientX + document.body.scrollLeft;
			tX = $("thumbDiv").style.left ;
			
			//$("sthumbDiv").style.position  = "fixed";
			//$("sthumbDiv").style.position="absolute";
			
			
			if (navigator.userAgent.indexOf("Firefox") != -1) {
				newThumb.style.position  = "absolute";
				tY = theEvent.pageY  -  document.body.scrollTop;
				tY = eval(tY - 125);			
			
			}else{
				newThumb.style.position  = "fixed";
				tY = theEvent.pageY  -  document.body.scrollTop;
				tY = eval(tY - 35);
			}
			
			
			
			
			//newThumb.style.position  = "absolute";
			
			newThumb.style.top= tY + 'px';
			newThumb.style.left= parseInt($('thumbDiv').style.left) - 143 + 'px';
			$(pid).style.backgroundImage = 'url(../img/bgonMouseOver.gif) ';
			
			
	}
	

	newThumb.style.visibility="visible";
	newThumb.style.backgroundImage = 'url(' + imgPath +')';
}//

function hideThumbDiv(pid,i){
	var newThumb;
	var tX=0;
	var tY= 0;
	newThumb = $("sThumbDiv");
	newThumb.style.width=0 + 'px';
	newThumb.style.height=0 + 'px';
	newThumb.style.visibility="hidden";
	if (selectedImage!=i){
		
		pid.style.background='none';
	}
	
}//





function loadImageArray(){
    var i =0;
    for (i=0;i<imgArr.length;i++){
		imageInst = new Image(); 
    }


}//



