var hide_si="";

var show_index ="";

var theImages = new Array()
theImages[0] = ["images/background-imgs/img01.jpg", 800, "Cr&eacute;dit Suisse<br>Saudi Arabia<br> opening Event, Riyadh", "An elegant lounge-seating setup, favoring private discussions in a relaxed environment."]
theImages[1] = ["images/background-imgs/Si_T1.jpg", 800, "Total Liban<br/>60th Anniversary<br/>Internal Celebration", "Off-road ride towards the highest peaks"]
theImages[2] = ["images/background-imgs/Si-Z2.jpg", 70, "Zoghbi Group<br/>Prime Center Inauguration<br/>Lebanon", "Visit of HE Mr. Michel Temer - Vice-President of Brazil"]
theImages[3] = ["images/background-imgs/img07.jpg", 640, "Sodamco<br>25th Anniversary Celebration, Lebanon", "This is when art wonderfully joins our concept in a highly aesthetic combination."]
theImages[4] = ["images/background-imgs/img08.jpg", 450, "Injaz<br>Young Arab Entrepreneurs Competition 2009, Lebanon", "Learning while enjoying."]
theImages[5] = ["images/background-imgs/img09.jpg", 660, "Bank Audi<br>Reception at Sofil Gardens, Beirut", ""]
theImages[6] = ["images/background-imgs/img11.jpg", 140, "ITG - Yearly Internal Celebration 2010, Lebanon", ""]
theImages[7] = ["images/background-imgs/img12.jpg", 600, "ITG - Yearly Internal Celebration 2010, Lebanon", "Even our placemats talk to the invitees"]
theImages[8] = ["images/background-imgs/img13.jpg", 125, "Byblos Bank<br>Annual Gathering 2010,<br>Lebanon", "A gigantic setup, all ready to start the evening!"]
theImages[9] = ["images/background-imgs/img14.jpg", 750, "BMB - Get-together & Technology Update 2010, Lebanon", "A fresh and colorful day"]
theImages[10] = ["images/background-imgs/img15.jpg", 620, "BMB - Get-together & Technology Update 2010, Lebanon", "Technology, branding and a chillout afternoon"]
theImages[11] = ["images/background-imgs/Si-BMB11-10.jpg", 850, "BMB Get-together & Technology Update 2011<br/>Lebanon", "A beautiful autumn day in the Lebanese mountains"]
theImages[12] = ["images/background-imgs/img17.jpg", 625, "Bank Audi<br>reception at Sofil Gardens, Beirut", "Smart lighting effects, making the most out of a diversified location."]
theImages[13] = ["images/background-imgs/img18.jpg", 122, "Sodamco<br>25th Anniversary Celebration, Lebanon", ""]
theImages[14] = ["images/background-imgs/img19.jpg", 650, "Sodamco<br>25th Anniversary Celebration, Lebanon", ""]
theImages[15] = ["images/background-imgs/img20.jpg", 640, "Sodamco<br>25th Anniversary Celebration, Lebanon", ""]
theImages[16] = ["images/background-imgs/Injaz-1797.jpg", 600, "Injaz<br>Young Arab Entrepreneurs Competition 2009, Lebanon",""]
theImages[17] = ["images/background-imgs/Si_T2.jpg", -100, "Total Liban<br/>60th Anniversary<br/>Internal Celebration", "Off-road ride towards the highest peaks"]
theImages[18] = ["images/background-imgs/Si-Z1.jpg", 570, "Zoghbi Group<br/>Prime Center Inauguration<br/>Lebanon", "Visit of HE Mr. Michel Temer - Vice-President of Brazil"]
theImages[19] = ["images/background-imgs/SD-0085.jpg", 620, "Sodamco<br>25th Anniversary Celebration, Lebanon", ""]
theImages[20] = ["images/background-imgs/SD-0082.jpg", 635, "Sodamco<br>25th Anniversary Celebration, Lebanon", ""]
theImages[21] = ["images/background-imgs/SD-0076.jpg", 200, "Sodamco<br>25th Anniversary Celebration, Lebanon", ""]
theImages[22] = ["images/background-imgs/Injaz-1924.jpg", 170, "Injaz<br>Young Arab Entrepreneurs Competition 2009, Lebanon", "Each element fits its right place to achieve the aim of the evening."]
theImages[23] = ["images/background-imgs/Si_T3.jpg", 800, "Total Liban<br/>60th Anniversary<br/>Internal Celebration", "A magical hike with the Cedars in Ehden Natural Reserve's beautiful valleys and gorges"]
theImages[24] = ["images/background-imgs/SD-0638.jpg", 150, "Sodamco<br>25th Anniversary Celebration, Lebanon", ""]
theImages[25] = ["images/background-imgs/L1001409.jpg", 660, "Fares Jammal <br>Photo Exhibition <br>Beirut, Lebanon", ""]
theImages[26] = ["images/background-imgs/Si-FP2.jpg", 660, "Fan Park 2010", "Beirut World Cup"]
theImages[27] = ["images/background-imgs/Si_FJ1.jpg", 560, "Fares Jammal<br>Book Launch and Photo Exhibition", "Haven't you seen this bicycle?"]
theImages[28] = ["images/background-imgs/Si_FJ3.jpg", 550, "Fares Jammal<br>Book Launch and Photo Exhibition", "Haven't you seen this bicycle?"]
theImages[29] = ["images/background-imgs/Si_FJ5.jpg", 750, "Fares Jammal<br>Book Launch and Photo Exhibition", "Haven't you seen this bicycle?"]
theImages[30] = ["images/background-imgs/Si_T4.jpg", 800, "Total Liban<br/>60th Anniversary<br/>Internal Celebration", "A magical hike in Ehden Natural Reserve's beautiful valleys and gorges"]
theImages[31] = ["images/background-imgs/Si_T5.jpg", 800, "Total Liban<br/>60th Anniversary<br/>Internal Celebration", "Cedar planting activity, symbolizing the company's historical ties to Lebanon"]
theImages[32] = ["images/background-imgs/Si_T6.jpg", 570, "Total Liban<br/>60th Anniversary<br/>Internal Celebration", ""]
theImages[33] = ["images/background-imgs/Si-BMB11-9.jpg", 810, "BMB Get-together & Technology Update 2011<br/>Lebanon", "Together 'in the Cloud'"]


var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}


$(document).ready(function() {
   
	
/* ------- SUBMENU --------- */
	$("#mainmenu li").hover(function() {
		$("#mainmenu li").css("z-index", 1001);
		$(this).css("z-index", 1010);
		var mytip = $(".tip", $(this));
		mytip.show().css({opacity: 0, top: -40 }).stop().animate({opacity: 1, top: -53 }, 250);
		/*$(document).pngFix();*/
	}, function(){
		var mytip = $(".tip", $(this));
		$(mytip).stop().animate({ opacity: 1 }, 300).animate({opacity: 0, top:-60 }, 100, function(){
	        $(this).hide();
	    });
		var mytip = $(".tip2", $(this));
		$(mytip).stop().animate({ opacity: 1 }, 300).animate({opacity: 0, top:-60 }, 100, function(){
	        $(this).hide();
	    }); 
	});
	
   /*
    $(".tip").hover(function() {      
           clearTimeout(hide_si);
       }, function(){
           $(this).stop().animate({opacity: 0 })
       });
    */
   
   setTimeout(function() {
       $("#close").click(function() {
   	    $("#content-wrapper").animate({opacity: 0, top: -400}, 400, function(){ $("#content-wrapper").hide() });
	 });
   }, 1200);
	 
	 // RANDOM IMAGE ON PAGE REFRESH
	 var rand_index = Math.floor(Math.random() * theImages.length);
	 if(typeof show_index == "number") rand_index = show_index;
	 $("#mid-images").css("background", "#fff url("+ theImages[rand_index][0] +") center top no-repeat");
     $("#caption-wrapper").attr("style", "");
     $("#internal-caption").attr("style", "left:"+theImages[rand_index][1] + "px !important");
     $("#internal-caption dt").html(theImages[rand_index][2]);
     $("#internal-caption dd").html(theImages[rand_index][3]);

	 
	  $("#content-wrapper").css({opacity: 1, top:-400}).show().animate({opacity: 1, top: -478}, 800);
	  
		$("h3#about-title").css("margin-top", 114);
});


$(window).load(function(){ 
$("#caption-wrapper").css("visibility", "visible") });

$(document).ready(function() {
    setTimeout(function() {
        if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
        	 if(!$("#content-wrapper .jScrollPaneContainer").length) {
        	     $("#content-wrapper *").css("font-size", "6pt")
        	 }
        }
    }, 200);
    
})
