/**
 * cross browser script for get window width and height
 */
var windowWidth, windowHeight;
if (self.innerHeight)
{
    windowWidth = self.innerWidth;
    windowHeight = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
{
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
}