var theTopPics = new Array();
theTopPics[1]  = "url('/SiteAssets/Images/topImages/AfricaTop.jpg')";
theTopPics[2]  = "url('/SiteAssets/Images/topImages/BotswanaTop.jpg')";
theTopPics[3]  = "url('/SiteAssets/Images/topImages/DubaiTop.jpg')";
theTopPics[4]  = "url('/SiteAssets/Images/topImages/EgyptTop.jpg')";
theTopPics[5]  = "url('/SiteAssets/Images/topImages/IndiaTop.jpg')";
theTopPics[6]  = "url('/SiteAssets/Images/topImages/JordanTop.jpg')";
theTopPics[7]  = "url('/SiteAssets/Images/topImages/MaldivesTop.jpg')";
theTopPics[8]  = "url('/SiteAssets/Images/topImages/MauritiusTop.jpg')";
theTopPics[9]  = "url('/SiteAssets/Images/topImages/MozambiqueTop.jpg')";
theTopPics[10] = "url('/SiteAssets/Images/topImages/NamibiaTop.jpg')";
theTopPics[11] = "url('/SiteAssets/Images/topImages/OmanTop.jpg')";
theTopPics[12] = "url('/SiteAssets/Images/topImages/RwandaTop.jpg')";
theTopPics[13] = "url('/SiteAssets/Images/topImages/SeychellesTop.jpg')";
theTopPics[14] = "url('/SiteAssets/Images/topImages/SouthAfricaTop.jpg')";
theTopPics[15] = "url('/SiteAssets/Images/topImages/SriLankaTop.jpg')";
theTopPics[16] = "url('/SiteAssets/Images/topImages/TanzaniaTop.jpg')";
theTopPics[17] = "url('/SiteAssets/Images/topImages/ZambiaTop.jpg')";

/*theTopPics[17] = "url('/SiteAssets/Images/topImages/UgandaTop.jpg')";*/

var thePics = new Array();
thePics[1] = "/mainimages1/Kenya_1.jpg";
thePics[2] = "/mainimages1/Botswana_1.jpg";
thePics[3] = "/mainimages1/Dubai_1.jpg";
thePics[4] = "/mainimages1/Egypt_1.jpg";
thePics[5] = "/mainimages1/India_1.jpg";
thePics[6] = "/mainimages1/Jordan_1.jpg";
thePics[7] = "/mainimages1/Maldives_1.jpg";
thePics[8] = "/mainimages1/Mauritius_1.jpg";
thePics[9] = "/mainimages1/Mozambique_1.jpg";
thePics[10] = "/mainimages1/Namibia_1.jpg";
thePics[11] = "/mainimages1/Oman_1.jpg";
thePics[12] = "/mainimages1/Rwanda_1.jpg";
thePics[13] = "/mainimages1/Seychelles_1.jpg";
thePics[14] = "/mainimages1/SouthAfrica_1.jpg";
thePics[15] = "/mainimages1/SriLanka_1.jpg";
thePics[16] = "/mainimages1/Tanzania_1.jpg";
thePics[17] = "/mainimages1/Zambia_1.jpg";

/*thePics[4] = "/mainimages1/Goa_1.jpg";*/

var ttpln = theTopPics.length - 1;
var tpln = thePics.length - 1;

var t=setTimeout("slideshow2()",5000);

function topslideshow(){
	var rn = Math.floor(Math.random() * ttpln + 1)
	document.getElementById('masthead').style.backgroundImage = theTopPics[rn];
	t=setTimeout("slideshow2()",5000);
}

function slideshow2(){
	var rn1 = Math.floor(Math.random() * tpln + 1)
	document.getElementById('masthead').style.backgroundImage = theTopPics[rn1];
	document.getElementById("slideshow").src = thePics[rn1];
	t=setTimeout("slideshow2()",5000);
}

function slideshow(){
	var thePics = new Array()
	thePics[1] = "http://www.somak.com/mainimages1/Botswana_1.jpg"
	thePics[2] = "http://www.somak.com/mainimages1/Dubai_1.jpg"
	thePics[3] = "http://www.somak.com/mainimages1/Egypt_1.jpg"
	thePics[4] = "http://www.somak.com/mainimages1/Goa_1.jpg"
	thePics[5] = "http://www.somak.com/mainimages1/India_1.jpg"
	thePics[6] = "http://www.somak.com/mainimages1/Jordan_1.jpg"
	thePics[7] = "http://www.somak.com/mainimages1/Kenya_1.jpg"
	thePics[8] = "http://www.somak.com/mainimages1/Maldives_1.jpg"
	thePics[9] = "http://www.somak.com/mainimages1/Mauritius_1.jpg"
	thePics[10] = "http://www.somak.com/mainimages1/Mozambique_1.jpg"
	thePics[11] = "http://www.somak.com/mainimages1/Namibia_1.jpg"
	thePics[12] = "http://www.somak.com/mainimages1/Oman_1.jpg"
	thePics[13] = "http://www.somak.com/mainimages1/Rwanda_1.jpg"
	thePics[14] = "http://www.somak.com/mainimages1/Seychelles_1.jpg"
	thePics[15] = "http://www.somak.com/mainimages1/SouthAfrica_1.jpg"
	thePics[16] = "http://www.somak.com/mainimages1/SriLanka_1.jpg"
	thePics[17] = "http://www.somak.com/mainimages1/Tanzania_1.jpg"
	thePics[18] = "http://www.somak.com/mainimages1/Zambia_1.jpg"



	var rn = Math.floor(Math.random() * thePics.length)
	if (rn == 0) {
	  rn = 1
	}

	img_slideshow = document.getElementById("slideshow");
	//alert(img_slideshow.src);
	img_slideshow.src = thePics[rn];
	//alert(img_slideshow.src);
	
	//MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?');
}

function slideshow_usa(){
	var thePics = new Array()
	thePics[1] = "http://www.somak.com/usa/Kenya1.jpg"
	thePics[2] = "http://www.somak.com/usa/Tanzania1.jpg"



	var rn = Math.floor(Math.random() * thePics.length)
	if (rn == 0) {
	  rn = 1
	}

	img_slideshow = document.getElementById("slideshow");
	//alert(img_slideshow.src);
	img_slideshow.src = thePics[rn];
	//alert(img_slideshow.src);
	
	//MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?');
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}


