function 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=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 reloadPage(init) {  //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
reloadPage(true);

function reloadPage(init) 
{
if (init==true) with (navigator) 
    {
        if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
            {
                document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; 
            }
    }
else if (innerWidth!=document.pgW || innerHeight!=document.pgH) 
    location.reload();
}
reloadPage(true);

function findObj(n, d) 
{
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=findObj(n,d.layers[i].document);
            if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function showHideLayers() 
{
var i,p,v,obj,args=showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) 
{ 
    v=args[i+2];
    if (obj.style) 
        { 
            obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; 
        }
    obj.visibility=v; 
}
}

function TopImageOver(img1,img2,ImgName,stat)
{
var slideShowSpeed = 50;
var crossFadeDuration = 3;
var Pic = new Array();

Pic[0] = img1
Pic[1] = img2

var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) 
{
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}

if (document.all) 
{
    document.images.SlideShow.style.filter="blendTrans(duration=2)";
    document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
    document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) 
{
    document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;

if (document.all) 
{
    document.images.pic2.style.filter="blendTrans(duration=2)";
    document.images.pic2.style.filter="blendTrans(duration=crossFadeDuration)";
    document.images.pic2.filters.blendTrans.Apply();
}
document.images.pic2.src = ImgName;
if (document.all) 
{
    document.images.pic2.filters.blendTrans.Play();
}
if (document.all) 
{
    document.images.pic1.style.filter="blendTrans(duration=2)";
    document.images.pic1.style.filter="blendTrans(duration=crossFadeDuration)";
    document.images.pic1.filters.blendTrans.Apply();
}

if (stat=='in'){
    document.images.pic1.src = "images/pic1_def.jpg";}
else if (stat=='out'){
    document.images.pic1.src = "images/pic1.jpg";}

if (document.all) 
{
    document.images.pic1.filters.blendTrans.Play();
}

}

function ImageOver(ImgName,ImgSrc,stat,MainPicImg)
{
if (typeof(document.images["pic1"])=="object")
{
    if (document.all) 
    {
        document.images.pic1.style.filter="blendTrans(duration=2)";
        document.images.pic1.style.filter="blendTrans(duration=crossFadeDuration)";
        document.images.pic1.filters.blendTrans.Apply();
    }
    if (stat=='in')
        document.images.pic1.src = "images/pic1_def.jpg";
    else if (stat=='out')
        document.images.pic1.src = "images/pic1.jpg";
    if (document.all) 
    {
        document.images.pic1.filters.blendTrans.Play();
    }  
}
if (typeof(document.images["pic2"])=="object")
{
    if (document.all) 
    {
        document.images.pic2.style.filter="blendTrans(duration=2)";
        document.images.pic2.style.filter="blendTrans(duration=crossFadeDuration)";
        document.images.pic2.filters.blendTrans.Apply();
    }
    document.images.pic2.src = MainPicImg;
    if (document.all) 
    {
        document.images.pic2.filters.blendTrans.Play();
    }
}

document.images[ImgName].src=ImgSrc;    
showHideLayers('ImageGallery','','hide','services','','hide','GroupComp','','hide');
if ((screen.availWidth < 1025) && (screen.availWidth > 800))    
{
    document.all.ImageGallery.style.left = 852;
    document.all.services.style.left = 756;
    document.all.GroupComp.style.left = 628;
}
else if ((screen.availWidth < 1153) && (screen.availWidth > 1024))
{
    document.all.ImageGallery.style.left = 980;
    document.all.services.style.left = 853;
    document.all.GroupComp.style.left = 708;
}    
if (ImgName=="ImgGallery")
{
    showHideLayers('ImageGallery','','show','services','','hide','GroupComp','','hide');
}
else if (ImgName=="ImgServices")
{
    showHideLayers('ImageGallery','','hide','services','','show','GroupComp','','hide');
}
else if (ImgName=="companies")
{
    showHideLayers('ImageGallery','','hide','services','','hide','GroupComp','','show');
}
}

function ImageOverForConti(ImgName,ImgSrc,stat,MainPicImg)
{
if (ImgName)
    document.images[ImgName].src=ImgSrc;
showHideLayers('ImageGallery','','hide','services','','hide','GroupComp','','hide');
if ((screen.availWidth < 1025) && (screen.availWidth > 800))    
{
    document.all.ImageGallery.style.left = 852;
    document.all.services.style.left = 756;
    document.all.GroupComp.style.left = 628;
}
else if ((screen.availWidth < 1153) && (screen.availWidth > 1024))
{
    document.all.ImageGallery.style.left = 980;
    document.all.services.style.left = 853;
    document.all.GroupComp.style.left = 708;
}

if (ImgName=="ImgGallery")
{
    showHideLayers('ImageGallery','','show','services','','hide','GroupComp','','hide');
}
else if (ImgName=="ImgServices")
{
    showHideLayers('ImageGallery','','hide','services','','show','GroupComp','','hide');                
}
else if (ImgName=="companies")
{
    showHideLayers('ImageGallery','','hide','services','','hide','GroupComp','','show');
}
}

function showtip2(current,e,text){
if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}
else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrollit_r2l(seed)
{
var m1  = "  Towards A Better Solution          "; 
var m2  = "    ....    ";
/*var m3  = "  Visit Us Now!      ";*/
/*var m4  = "  Noell Operations, Abu Dhabi!       ";*/
/*var m5  = "  LOOOK........   Great!!  ";*/
var msg=m1+m2+m2+m2+m2;
var out = "Welcome to IMCC Operations, Abu Dhabi          ";
var c   = 1;
if (seed > 100) {
seed--;
var cmd="scrollit_r2l(" + seed + ")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
  out+=" ";
}
out+=msg;
seed--;
var cmd="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
  out+=msg.substring(-seed,msg.length);
  seed--;
  var cmd="scrollit_r2l(" + seed + ")";
  window.status=out;
  timerTwo=window.setTimeout(cmd,100);
}
else {
  window.status=" ";
  timerTwo=window.setTimeout("scrollit_r2l(100)",75);
}
}
}

function JobSearchResult()
{
    if (DefaultForm.Position.value=="")
    {
        alert("You need to select atleast one position");
        document.DefaultForm.Position.focus;
        return false;
    }


    {
        DefaultForm.method="post"
        DefaultForm.action="JobSearchResult.asp";
        DefaultForm.submit();
    }

}

function SearchJob(i)
{
    frmmain.JobId.value=i;
    frmmain.submit();
}

function CheckLocForSidePic(picName)
{
    document.images["side_pic"].src = picName;
}

function GalWin(ImgName)
{
        w = 650;
        h = 600;
        var winl = (screen.width - w) / 2;
        var wint = (screen.height - h) / 2;

        winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=yes';
        win = window.open('','ImageWin', winprops);  
        win.document.write ("<html><head><title>IMCC, Abu Dhabi</title></head><body topmargin='50' leftmargin='0' bgcolor='#000000'>");
        win.document.write ("<center><p><img src='"+ImgName+"'></p><p>&nbsp;</p><p><input type='button' name='button' value='Close Window' onClick='javascript:self.close()'></p></center></html>");
}