/*   */

// Global Variables
var loadedOnes = new Array();
var globalx = 0;
var globaly = 0;
var iamiphone = 0;


function indexInArray(arr,val){
    for(var i=0;i<arr.length;i++) if(arr[i]==val) return i;
    return -1;
}
//
function dothis(me) {
    ox = globalx-891;
    oy = globaly-480;

//    var x = globalx-ox/2;
//    var y = globaly-oy/2;

    var x = - (ox/2);
    var y = - (oy/2);

    
//    $("#sidebody").animate( { left:  -x + "px", top:  -y + "px"  }, { queue:false, duration: 3000 } );
    $("#sidebody").css( { left:  -x + "px", top:  -y + "px"  });
}
//
function theresize(bwidth,bheight) {
    if (iamiphone!=1) {
        var ymax=screen.availHeight;
        var xmax=screen.availWidth;
        self.moveTo(0,0);
        window.resizeTo(xmax,ymax);
    //
        var x,y;
        if (self.innerHeight) // all except Explorer
        {
            x = self.innerWidth;
            y = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
            // Explorer 6 Strict Mode
        {
            x = document.documentElement.clientWidth;
            y = document.documentElement.clientHeight;
        }
        else if (document.body) // other Explorers
        {
            x = document.body.clientWidth;
            y = document.body.clientHeight;
        }
        
        ymaxdiff=ymax-y;
        xmaxdiff=xmax-x;
        globaly = y;
        globalx = x;
    } else {
 //       alert("iphone");
        globalx = 891;
        globaly = 480;
    }
    dothis(1, "first");
}





