﻿// JScript File
var popIndex;
    function showfoto(photo, title, index)
    {
        var titleSpan = document.getElementById("titleSpan");
        titleSpan.innerText = title;
        
        var path = '../assets/photos/';
        var img = document.getElementById("projImg");
        img.src = path + photo;
        
        //popIndex = index;
        
        var lnkImg = document.getElementById("ctl00_PageContentPlaceHolder_Gallery1_lnkImg");
        
        lnkImg.setAttribute("href", path + photos[index]);
        lnkImg.setAttribute("title", titles[index]);

        decoGreyboxLinks();        
    }
    
    function PopUpWin(photo, title) {
        var iMyWidth;
        var iMyHeight;
        var width = 600;
        var height = 400;
        //half the screen width minus half the new window width (plus 5 pixel borders).
        iMyWidth = (window.screen.width/2) - ((width/2) + 10);
        //half the screen height minus half the new window height (plus title and status bars).
        iMyHeight = (window.screen.height/2) - ((height/2) + 50);
        //Open the window.
        var popUpWin = window.open("big_image.aspx","bigimg","status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
        popUpWin.focus();
    }
    
    function preloadImages()
    {
        if (document.images)    {
            var preload_image_object;
            var path = '../assets/photos/';
            for(i=0;i<photos.length;i++)
            {
                preload_image_object = new Image();
                preload_image_object.src = path + photos[i];
            }
        }   
    }
    
    var oNavWin ;
	function OpenNavWindow (filename,x,y,w,h)
	{
		var settings;
		ypos=x;
		xpos=y;
		settings="status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,titlebar=no, left=" + xpos + ",top=" +ypos + ",width=" + w + ",height=" + h;
		oNavWin = self.parent.open(filename,"Zoom", settings);
	} 
	
	function FillMarquee(){
	    var text_arr = new Array();
	    text_arr[0] =  "Ahmed Ibrahim  “Luck is what happens when preparation meets opportunity. If a window of opportunity appears, don't pull down the shade.”";
	    text_arr[1] = "Mr. Ahmed Maher “God never squanders the recompense to he who is good, benevolant to himself and others.”";
	    text_arr[2] = "Engineer Magdy El Shiaty “I acsertain that management should be customer satisfaction and client driven management (CDM). CDM will be achieved through the ideal exploitation of resources at hand, realizing the golden triangle; quality, time, cost.”";
	    text_arr[3] = "Mr. Mostafa Labib “False, to who dares to attain pursuits and quests by sheer desire, for he who desires must struggle, vanquish and surmount. Grab Life by the horns.”";
	    text_arr[4] = "Nader Mashhour “It is imperative to love and moreover be ardent to the work place.  For he who strives to achieve, will do so, with a passion from the learning experience, and the serenity he begets from blendng with the team.”";
	    text_arr[5] = "Engineer Samia Gaber “Dicipline, diligence, commitment, consistency and perseverance are rules of thumb for exactitude.”";
	    text_arr[6] = "Sherif Montasser “I believe in 3 things, People, Ideas and finance. Find the right people, allocate the right amount of money, and make way for the fastest method of transporting information and ideas between divisions.”";
    	
	    var spacing = "<img src='1_blank.gif alt='' border='0' width='200' height='2'>"
        var i = 0;
        var random;
        var marquee = document.getElementById("txtMarquee");
        
        while (i < text_arr.length){
            random = Math.floor(Math.random() * text_arr.length)
            if (text_arr[random] != "selected"){
            marquee.innerHTML += text_arr[random] + spacing;
            text_arr[random] = "selected";
            i++;
            }
        }
    }