function randomNumber (m,n){
    m = parseInt(m);
    n = parseInt(n);
    return Math.floor( Math.random() * (n - m + 1) ) + m;
}

function showImage(pageId,parentPageId) {
    var folders=new Array;
    var counts=new Array;
    
    folders[-1]='/home_page';
    counts[-1]=5;
    folders[3]='/company_profile';
    counts[3]=1;
    folders[4]='/projects';
    counts[4]=5;
    folders[5]='/capabilities';
    counts[5]=7;

    var folder='/home_page';
    var count=randomNumber(1,5);
    if (folders[pageId]!=undefined){
        folder=folders[pageId];
        count=randomNumber(1,counts[pageId]);
    } else if (folders[parentPageId]!=undefined) {
        folder=folders[pageId];
        count=randomNumber(1,counts[pageId]);
    } else {
        //alert(pageId+" - "+parentPageId);
    }

    document.write('<img src="/images/top'+folder+'/top_'+count+'.gif" width="651" height="269">');
}
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_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_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 mapLoad(){
    var mapElement9 = null;
    mapElement9 = document.getElementById("map9");
    var mapElement10 = null;
    mapElement10 = document.getElementById("map10");
    var mapElement11 = null;
    mapElement11 = document.getElementById("map11");
    var mapElement12 = null;
    mapElement12 = document.getElementById("map12");
    var mapElement13 = null;
    mapElement13 = document.getElementById("map13");
    var mapElement14 = null;
    mapElement14 = document.getElementById("map14");
    var mapElement15 = null;
    mapElement15 = document.getElementById("map15");
    var mapElement16 = null;
    mapElement16 = document.getElementById("map16");
    var mapElement17 = null;
    mapElement17 = document.getElementById("map17");
    var mapElement18 = null;
    mapElement18 = document.getElementById("map18");
    var mapElement19 = null;
    mapElement19 = document.getElementById("map19");  
	var mapElement20 = null;
    mapElement20 = document.getElementById("map20");
	
    var map;
    //--9
    if(mapElement9!=null){
        map = new GMap(mapElement9);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-146.678466796875, 70.11048478105927), 9);
    }
    //--10
    if(mapElement10!=null){
        map = new GMap(mapElement10);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-159.2578125, 68.8437003002301), 9);
    }
    //--11
    if(mapElement11!=null){
        map = new GMap(mapElement11);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-147.7001953125, 64.87227342925095), 9);
    }
    //--12
    if(mapElement12!=null){
        map = new GMap(mapElement12);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-149.89449977874756, 61.21797861520846), 1);
    }
    //--13
    if(mapElement13!=null){
        map = new GMap(mapElement13);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-134.58251953125, 58.40746759910687), 9);
    }
    //--14
    if(mapElement14!=null){
        map = new GMap(mapElement14);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-145.73089599609375, 64.03614895458168), 9);
    }
    //--15
    if(mapElement15!=null){
        map = new GMap(mapElement15);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-132.36328125, 65.54936668811527), 9);
    }
    //--16
    if(mapElement16!=null){
        map = new GMap(mapElement16);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(152.578125, 62.63376960786813), 9);
    }
    //--17
    if(mapElement17!=null){
        map = new GMap(mapElement17);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(142.646484375, 53.33087298301704), 9);
    }
    //--18
    if(mapElement18!=null){
        map = new GMap(mapElement18);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(142.84423828125, 51.984880139916626), 9);
    }
    //--19
    if(mapElement19!=null){
        map = new GMap(mapElement19);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(51.30615234375, 47.092565552235676), 9);
    }
    //--20
    if(mapElement20!=null){
        map = new GMap(mapElement20);
        map.setMapType(G_HYBRID_TYPE);
        map.addControl(new GSmallMapControl());
        map.centerAndZoom(new GPoint(-135.05218505859375, 58.81658607941149), 9);
    }
}