var global_continuePresentation = true;
var global_tID_presentation;
var DELAY_PRESENTATION = 5000;
var DELAY_FADE_PRESENTATION = 350;
var STEPS_PRESENTATION = 10;
var global_nextPresentation = 1;
var global_flashRunning = false;
var global_presention_allowed = true;
var isOldSafari = false;
if (jQuery.browser.safari && (jQuery.browser.version < 313)) {
  isOldSafari = true;
  global_presention_allowed = false;
  DELAY_PRESENTATION = 4000;
  DELAY_FADE_PRESENTATION = 10;
  STEPS_PRESENTATION = 3
}
function stopPresentation() {
  if (global_tID_presentation) {
    clearTimeout(global_tID_presentation)
  }
  global_continuePresentation = false
}
function resetAllStepLink() {
  jQuery("#StepImage").html('<div id="TexteImage"></div>');
  jQuery("#HowitWorks").css({
    background: "",
    color: "#888666"
  });
  jQuery("#NewsFromUs").css({
    background: "",
    color: "#888666"
  });
  jQuery("#AllourSitesareUnique").css({
    background: "",
    color: "#888666"
  });
  jQuery("#SatisfactionGuaranteed").css({
    background: "",
    color: "#888666"
  });
  jQuery("#StateoftheArtWebsites").css({
    background: "",
    color: "#888666"
  });
  jQuery("#WEWorkWithYOU").css({
    background: "",
    color: "#888666"
  });
  jQuery("#ReplayAnimation").css({
    background: "",
    color: "#888666"
  }).html("Others")
}
var sHowitWorks = 'No doubt that Gaining trust among governmental level reflects our professional rank.Qatar government was in need to secure their online tendering system. Our client (Qatar foundation) trusted our company for this challenging mission.  The project was held by us, audited and approved by one of the largest American information security companies reporting &quot;NO SECURITY HOLES FOUND&quot;';
var sNewsFromUs = "As a big stock holding company talaat mostafa holding was in an intensive need to show their stocks real-time news on their own web site, the project was held and implemented by our teamwork in a relatively very short time showing  the coordination talents of our management to manage our teamwork different departments.";
var sAllourSitesareUnique = "It is well known that Vodafone owns one of the greatest data centers in the Middle East.  However Vodafone chose HOSTWARE servers to be one of their hosts to assure redundancy and high performance, trusting in our efficient and effective network security capabilities.";
var sSatisfactionGuaranteed = "Saudi Arabia government's policy restricts hosting of their public sector data exclusively at local servers inside the kingdom; however the Ministry of Education trusted our technical capabilities to host their back up servers for online services continuity assurance purpose.";
var sStateoftheArtWebsites = "Etisalat chose us to enhance the official website of the Egyptian Ahly Sports Club giving it a new spirit. As we are already the consultant and the host for filgoal.com we invested our experience in dealing with high traffic sports portals and we accomplished the project with more than a feeling.";
var sWEWorkWithYOU = "Challenging time, we managed to develop savola Egypt official dynamic web site within just 24 hours given that our client provided us with the web  contents and  requirements very clearly .";
var sPlayAnimation = 'We are honored to work for some Arabian security authorities which we are not allowed to provide any information about.';

function _HomeStepHowitWorks() {
  resetAllStepLink();
  jQuery("#TexteImage").html(sHowitWorks);
  jQuery("#StepImage").css({
    background: "url(images/Special.jpg) no-repeat 0px 0px"
  });
  jQuery("#HowitWorks").css({
    background: "url(images/Web-Design-Icons.jpg) right -240px no-repeat",
    color: "#000000"
  });
  global_nextPresentation = 2
}
function _HomeStepNewsFromUs() {
  resetAllStepLink();
  jQuery("#TexteImage").html(sNewsFromUs);
  jQuery("#StepImage").css({
    background: "url(images/News.jpg) no-repeat 0px 0px"
  });
  jQuery("#NewsFromUs").css({
    background: "url(images/Web-Design-Icons.jpg) right -200px no-repeat",
    color: "#000000"
  });
  global_nextPresentation = 3
}
function _HomeStepAllourSitesareUnique() {
  resetAllStepLink();
  jQuery("#TexteImage").html(sAllourSitesareUnique);
  jQuery("#StepImage").css({
    background: "url(images/AllourSitesareUnique.jpg) no-repeat 0px 0px"
  });
  jQuery("#AllourSitesareUnique").css({
    background: "url(images/Web-Design-Icons.jpg) right -160px no-repeat",
    color: "#000000"
  });
  global_nextPresentation = 4
}
function _HomeStepSatisfactionGuaranteed() {
  resetAllStepLink();
  jQuery("#TexteImage").html(sSatisfactionGuaranteed);
  jQuery("#StepImage").css({
    background: "url(images/SatisfactionGuaranteed.jpg) no-repeat 0px 0px"
  });
  jQuery("#SatisfactionGuaranteed").css({
    background: "url(images/Web-Design-Icons.jpg) right -120px no-repeat",
    color: "#000000"
  });
  global_nextPresentation = 5
}
function _HomeStepStateoftheArtWebsites() {
  resetAllStepLink();
  jQuery("#TexteImage").html(sStateoftheArtWebsites);
  jQuery("#StepImage").css({
    background: "url(images/StateoftheArtWebsites.jpg) no-repeat 0px 0px"
  });
  jQuery("#StateoftheArtWebsites").css({
    background: "url(images/Web-Design-Icons.jpg) right -80px no-repeat",
    color: "#000000"
  });
  global_nextPresentation = 6
}
function _HomeStepReplayAnimation() {
  resetAllStepLink();
  jQuery("#TexteImage").html(sPlayAnimation);
  jQuery("#StepImage").css({
    background: "url(images/ReplayAnimation.jpg) no-repeat 0px 0px"
  });
  jQuery("#ReplayAnimation").css({
    background: "url(images/Web-Design-Icons.jpg) right 0px no-repeat",
    color: "#000000"
  }).html("Others");
  global_nextPresentation = 1
}
function _HomeStepWEWorkWithYOU() {
  resetAllStepLink();
  jQuery("#TexteImage").html(sWEWorkWithYOU);
  jQuery("#StepImage").css({
    background: "url(images/WEWorkWithYOU.jpg) no-repeat 0px 0px"
  });
  jQuery("#WEWorkWithYOU").css({
    background: "url(images/Web-Design-Icons.jpg) right -40px no-repeat",
    color: "#000000"
  });
  global_nextPresentation = 7
}
function processSlide(A, B) {
  if (global_continuePresentation && global_presention_allowed) {
    jQuery("#StepImage").fadeOut(DELAY_FADE_PRESENTATION, function() {
      A.call(this);
      jQuery("#StepImage").fadeIn(DELAY_FADE_PRESENTATION, function() {
        if (!global_continuePresentation) {
          return true
        }
        global_tID_presentation = setTimeout(B, DELAY_PRESENTATION)
      })
    })
  } else {
    if (global_continuePresentation && isOldSafari) {
      A.call(this);
      if (!global_continuePresentation) {
        return true
      }
      global_tID_presentation = setTimeout(B, DELAY_PRESENTATION)
    }
  }
}
function slide1() {
  processSlide(function() {
    _HomeStepHowitWorks()
  }, "slide12();")
}
function slide12() {
  processSlide(function() {
    _HomeStepNewsFromUs()
  }, "slide2();")
}
function slide2() {
  processSlide(function() {
    _HomeStepAllourSitesareUnique()
  }, "slide3();")
}
function slide3() {
  processSlide(function() {
    _HomeStepSatisfactionGuaranteed()
  }, "slide4();")
}
function slide4() {
  processSlide(function() {
    _HomeStepStateoftheArtWebsites()
  }, "slide5();")
}
function slide5() {
  processSlide(function() {
    _HomeStepWEWorkWithYOU()
  }, "slide6();")
}
function slide6() {
  processSlide(function() {
    _HomeStepReplayAnimation()
  }, "slide1();")
}
function showPresentation() {
  if (global_tID_presentation) {
    clearTimeout(global_tID_presentation)
  }
  if (global_continuePresentation) {
    switch (global_nextPresentation) {
    case 1:
      slide1();
      break;
    case 2:
      slide12();
      break;
    case 3:
      slide2();
      break;
    case 4:
      slide3();
      break;
    case 5:
      slide4();
      break;
    case 6:
      slide5();
      break;
    case 7:
      slide6();
      break
    }
  }
}
function startPresentation() {
  if (global_tID_presentation) {
    clearTimeout(global_tID_presentation)
  }
  if (!global_flashRunning) {
    global_continuePresentation = true;
    global_tID_presentation = setTimeout(function() {
      showPresentation()
    }, DELAY_PRESENTATION)
  }
}
function linkControlPresentation() {
  jQuery("#HowitWorks, #NewsFromUs, #AllourSitesareUnique, #SatisfactionGuaranteed, #StateoftheArtWebsites, #WEWorkWithYOU, #ReplayAnimation").bind("mouseout", function() {
    startPresentation()
  }).bind("mousemove", function() {
    stopPresentation()
  })
}
function openPresentation() {
  linkControlPresentation();
  _HomeStepHowitWorks();
  global_nextPresentation = 2;
  global_tID_presentation = setTimeout(function() {
    showPresentation()
  }, DELAY_PRESENTATION)
}
var f_objet;
var f_etape;
var f_objet_cb;
var vitesseFondu;
var fonduAfter;
var fonduON;

function setOpacity(A) {
  f_objet_cb.opacity = A;
  f_objet_cb.MozOpacity = A;
  f_objet_cb.KhtmlOpacity = A;
  f_objet_cb.filter = "alpha(opacity=" + A * 100 + ")"
}
function fonduCache(A) {
  if (fonduON) {
    setOpacity(f_etape);
    f_etape = f_etape - vitesseFondu;
    if (f_etape > (A - vitesseFondu)) {
      setTimeout(function() {
        fonduCache(A)
      }, 10)
    } else {
      if (fonduAfter) {
        f_objet_cb.display = "none";
        fonduAfter = false
      }
    }
  }
}
function fonduAffiche(A) {
  if (fonduON) {
    setOpacity(f_etape);
    f_etape = f_etape + vitesseFondu;
    if (f_etape < (A + vitesseFondu)) {
      setTimeout(function() {
        fonduAffiche(A)
      }, 10)
    } else {
      if (fonduAfter) {
        f_objet_cb.display = "none";
        fonduAfter = false
      }
    }
  }
}
function backgroundChange(A, B, D, C, E) {
  fonduON = false;
  if (C) {
    vitesseFondu = C
  } else {
    vitesseFondu = 0.1
  }
  if (E) {
    fonduAfter = true
  }
  f_objet = document.getElementById(A);
  f_objet_cb = document.getElementById(A).style;
  if (D) {
    Opacity = D
  } else {
    if (f_objet.currentStyle) {
      objetStyle = f_objet.currentStyle;
      Opacity = objetStyle.opacity
    } else {
      if (f_objet.style.opacity !== null) {
        Opacity = f_objet.style.opacity
      } else {
        Opacity = 1
      }
    }
  }
  fonduON = true;
  if (B) {
    if (Opacity >= B) {
      f_etape = Opacity * 1;
      fonduCache(B)
    } else {
      if (Opacity <= B) {
        f_etape = Opacity * 1;
        fonduAffiche(B)
      }
    }
  } else {
    if (Opacity >= 0.5) {
      f_etape = Opacity * 1;
      fonduCache(0)
    } else {
      if (Opacity <= 0.5) {
        f_etape = Opacity * 1;
        fonduAffiche(1)
      }
    }
  }
}
function infopop(B) {
  jQuery("#hBox" + B).css({
    background: "url(images/Box" + B + "Over.jpg) left center no-repeat"
  });
  /*jQuery("#hBox" + B).addClass("divOver" + B);*/
  infopopBase = document.getElementById("hBox");
  var C = findPos(infopopBase);
  document.getElementById("infopopFond" + B).style.left = C[0] + 19 + "px";
  document.getElementById("infopopFond" + B).style.top = C[1] - 110 + "px";
  document.getElementById("infopop" + B).style.left = C[0] + 19 + "px";
  document.getElementById("infopop" + B).style.top = C[1] - 95 + "px";
  block("infopopFond" + B);
  block("infopop" + B);
  var A = "infopoptxt" + B;
  backgroundChange(A, 1, 0, 0.03)
}
function eXinfopop(B) {
  fonduON = false;
  document.getElementById("hBox" + B).style.background = "none";
  none("infopopFond" + B);
  none("infopop" + B);
  var A = "infopoptxt" + B;
  f_objet_cbInfP = document.getElementById(A).style;
  f_objet_cbInfP.opacity = 0;
  f_objet_cbInfP.MozOpacity = 0;
  f_objet_cbInfP.KhtmlOpacity = 0;
  f_objet_cbInfP.filter = "alpha(opacity=0)"
}
jQuery.fn.extend({
  slideUpEase: function(A, B) {
    return this.animate({
      marginTop: "-545px"
    }, {
      duration: 1000,
      easing: "easeOutExpo"
    }, B)
  },
  slideDownEase: function(A, B) {
    return this.animate({
      marginTop: 0
    }, {
      duration: 1000,
      easing: "easeOutExpo"
    }, B)
  }
});

function slideUpTop() {
  jQuery("#absolute").removeClass("opened");
  jQuery(document).unbind("click", slideUpTop);
  jQuery("#absolute").slideUpEase();
  jQuery(document).unbind("click", slideUpTop)
}
function igniteSlideHighlights() {
  execFirstAction();
  openPresentation()
}
jQuery(document).ready(function() {
  setTimeout(function() {
    none("PreLoading")
  }, 500);
  jQuery("#slideheader").css({
    opacity: 0.9
  });
  jQuery(".topexit").bind("click", function() {
    if (jQuery("#absolute").hasClass("opened")) {
      slideUpTop()
    } else {
      jQuery("#absolute").slideDownEase();
      jQuery("#absolute").addClass("opened");
      setTimeout(function() {
        jQuery(document).bind("click", slideUpTop)
      }, 100)
    }
  });
  jQuery("#hBox1").bind("mouseenter", function() {
    infopop(1)
  }).bind("mouseleave", function() {
    eXinfopop(1)
  });
  jQuery("#hBox2").bind("mouseenter", function() {
    infopop(2)
  }).bind("mouseleave", function() {
    eXinfopop(2)
  });
  jQuery("#hBox3").bind("mouseenter", function() {
    infopop(3)
  }).bind("mouseleave", function() {
    eXinfopop(3)
  });
  jQuery("#hBox1i").bind("click", function() {
    window.open("http://www.host-ware.com")
  });
  jQuery("#hBox2i").bind("click", function() {
    window.open("http://www.cairocall.com")
  });
  jQuery("#hBox3i").bind("click", function() {
    window.open("http://www.mails-sms.com")
  });
  jQuery("#pressqr").bind("mousemove", function() {
    stopPresentation()
  }).bind("mouseover", function() {
    stopPresentation()
  }).bind("mouseout", function() {
    startPresentation()
  });
  jQuery("#WEWorkWithYOU, #StateoftheArtWebsites, #SatisfactionGuaranteed, #AllourSitesareUnique, #NewsFromUs, #HowitWorks").bind("mousemove", function() {
    stopPresentation()
  }).bind("mouseout", function() {
    startPresentation()
  })
});
var first_tab_name = "Q F";
var AreuPlacer2 = '<div id="HomeStepLien"><span><b>Case Study Highlights</b></span><div onmouseover="stopPresentation();" onmousemove="stopPresentation();" onmouseout="startPresentation();"> <a href=\'javascript:void(0);\' onmouseover="showHomeStepHowitWorks();" id="HowitWorks">' + first_tab_name + '</a> <a href=\'javascript:void(0);\' onmouseover="HomeStepNewsFromUs();"  id="NewsFromUs">TMG</a> <a href=\'javascript:void(0);\' onmouseover="showHomeStepAllourSitesareUnique();" id="AllourSitesareUnique">Vodafone Egypt</a> <a href=\'javascript:void(0);\' onmouseover="showHomeStepSatisfactionGuaranteed();" id="SatisfactionGuaranteed">MOE KSA</a> <a href=\'javascript:void(0);\' onmouseover="showHomeStepStateoftheArtWebsites();" id="StateoftheArtWebsites">Ahly Egypt</a> <a href=\'javascript:void(0);\' onmouseover="showHomeStepWEWorkWithYOU();" id="WEWorkWithYOU">Savola</a> <a href=\'javascript:void(0);\' onmouseover="showHomeStepReplayAnimation();"  id="ReplayAnimation">Others</a></div></div>';
var AreuPlacer = '<div id="HomeStepLien"><span>Case Study Highlights</span><div onmouseover="stopPresentation();" onmousemove="stopPresentation();" onmouseout="startPresentation();"> <a href="javascript:void(0);" onmouseover="FlashRemove(); showHomeStepHowitWorks();" id="HowitWorks">' + first_tab_name + '</a> <a href="javascript:void(0);" onmouseover="FlashRemove(); HomeStepNewsFromUs();" id="NewsFromUs">News & Updates</a> <a href="javascript:void(0);" onmouseover="FlashRemove(); showHomeStepAllourSitesareUnique();" id="AllourSitesareUnique">All of our Work is Unique</a> <a href="javascript:void(0);" onmouseover="FlashRemove(); showHomeStepSatisfactionGuaranteed();" id="SatisfactionGuaranteed">100% Satisfaction Guaranteed</a> <a href="javascript:void(0);" onmouseover="FlashRemove(); showHomeStepStateoftheArtWebsites();" id="StateoftheArtWebsites">State of the Art Websites</a> <a href="javascript:void(0);" onmouseover="FlashRemove(); showHomeStepWEWorkWithYOU();" id="WEWorkWithYOU">WE Work With YOU</a> <a href=\'javascript:void(0);\' onmouseover="FlashRemove(); showHomeStepReplayAnimation();"  id="ReplayAnimation">Others</a></div></div>';

function activeMenu() {
  jQuery("#StepMenuFadeI").html(AreuPlacer);
  jQuery("#StepMenuFadeI").animate({
    opacity: 1
  }, 30)
}
function startPresentationAfterFlash() {
  global_flashRunning = false;
  if (jQuery.browser.msie) {
    activeMenu()
  }
}
function __showPresentation() {}
function showHomeStepHowitWorks() {
  stopPresentation();
  _HomeStepHowitWorks()
}
function HomeStepNewsFromUs() {
  stopPresentation();
  _HomeStepNewsFromUs()
}
function showHomeStepAllourSitesareUnique() {
  stopPresentation();
  _HomeStepAllourSitesareUnique()
}
function showHomeStepSatisfactionGuaranteed() {
  stopPresentation();
  _HomeStepSatisfactionGuaranteed()
}
function showHomeStepStateoftheArtWebsites() {
  stopPresentation();
  _HomeStepStateoftheArtWebsites()
}
function showHomeStepWEWorkWithYOU() {
  stopPresentation();
  _HomeStepWEWorkWithYOU()
}
function showHomeStepReplayAnimation() {
  stopPresentation();
  _HomeStepReplayAnimation()
}
function afterflash() {
  activeMenu();
  startPresentationAfterFlash();
  showHomeStepReplayAnimation();
  global_continuePresentation = true;
  jQuery("#PreLoadingAll").animate({
    opacity: 0
  }, 250, function() {
    none("PreLoadingAll");
    jQuery("#StepImage").css({
      "z-index": 0
    });
    setTimeout(function() {
      showPresentation()
    }, DELAY_PRESENTATION)
  })
}
var opentabonload = 1;

function opentab() {
  switch (opentabonload) {
  case 1:
    showHomeStepHowitWorks();
    break;
  case 2:
    showNewsFromUs();
    break;
  case 3:
    showHomeStepAllourSitesareUnique();
    break;
  case 4:
    showHomeStepSatisfactionGuaranteed();
    break;
  case 5:
    showHomeStepStateoftheArtWebsites();
    break;
  case 6:
    showHomeStepWEWorkWithYOU();
    break;
  case 7:
    showHomeStepReplayAnimation();
    break;
  default:
    showHomeStepHowitWorks();
    break
  }
}
function cacheHomeStepMenu() {
  jQuery("#StepMenuFadeI").animate({
    opacity: 0.3
  }, 10)
}
function FlashRemove() {
  jQuery("#StepImage").html('<div id="TexteImage"></div>');
  jQuery("#StepMenuFadeI").html(AreuPlacer2)
}
var HomeTTT;

function activeMenuSuite() {}
var FlashHome = '<object type="application/x-shockwave-flash" data="/Data/Visual/Preloader.swf" width="384" height="362"> <param name="movie" value="/Data/Visual/Preloader.swf" /> <param name="quality" value="High" /> <param name="scale" value="ExactFit" /> <param name="wmode" value="transparent" /> <a href="http://www.macromedia.com/go/getflashplayer">Download Flash plugin to properly see this content.</a> </object>';
var tmHomeFlashT;

function afficheHomeFlashAnim() {
  tmHomeFlashT = setTimeout(function() {
    jQuery("#StepImage").html(FlashHome)
  }, 0)
}
// function ResetHome() {
//   var A = '<div id="HomeStepLien"><span>Why NoamDesign?</span><div onmouseover="stopPresentation();" onmousemove="stopPresentation();" onmouseout="startPresentation();"> <a href=\'javascript:void(0);\' id="HowitWorks">' + first_tab_name + "</a> <a href='javascript:void(0);' id=\"NewsFromUs\">News & Updates</a> <a href='javascript:void(0);' id=\"AllourSitesareUnique\">All of our Work is Unique</a> <a href='javascript:void(0);' id=\"SatisfactionGuaranteed\">100% Satisfaction Guaranteed</a> <a href='javascript:void(0);' id=\"StateoftheArtWebsites\">State of the Art Websites</a> <a href='javascript:void(0);' id=\"WEWorkWithYOU\">WE Work With YOU</a> <a href='javascript:void(0);' id=\"ReplayAnimation\">Others</a> </div></div>";
//   jQuery("#StepMenuFadeI").html(A);
//   cacheHomeStepMenu();
//   afficheHomeFlashAnim();
//   block("PreLoadingAll");
//   jQuery("#PreLoadingAll").animate({
//     opacity: 0.75
//   }, 250);
//   document.getElementById("StepImage").style.zIndex = 999999;
//   global_flashRunning = true;
//   stopPresentation()
// };

