var url = "http://game.hspb.net";
var title = "Free Flash Games";

function CreateBookmarkLink() 
{
	if (window.sidebar) 
	{
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) 
	{
		window.external.AddFavorite( url, title);
	}
	else if(window.opera && window.print) 
	{
		return true; 
	}
}

function openWindow(url) {
    var width = 600;
    var height = 400;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + "toolbar=no,location=no,status=no,menubar=no,scrollbars=no";
    myWindow = window.open(url,"subWind",windowFeatures);
}
function trim(i){i=i.replace(/([ \t\r\n\f])*$/gi,""); return i.replace(/^([ \t\r\n\f])*/gi,"");}

function setHomePage(){
    if(document.all){
        var homepage = document.getElementById('set_domain');
        if(!homepage)
            return;
        var ishp = false;
        for(var i=0;i<ZingD.length;i++)                     /*Check homepage*/
        {
            if(homepage.isHomePage('http://game.hspb.net'))
            {
                ishp = true;
                break;
            }
        }  
        if(!ishp){
            homepage.style.behavior='url(#default#homepage)';            
            homepage.setHomePage(url);                  /*Set homepage*/
        }
    }
    else
        alert('Select Tools > Option > Main > Use Current Page (Alt+C) Add to HomePage!');
};

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
