/********************************************************************************************
       
	   YACER.COM Expand to FullScreen 1.1

-- Filename:
expand2fullscreen11.js
-- Credits:
Program by Christine (cs@yacer.com) 2004.5
-- Describtion:
Expand to Virtul Fullscreen mode different from open popup fullscreen window,
no matter what original window is maximized or not!
And also works with frames page. 
-- Usage:
1.Simply copy this script to between <head></head> 
2.<a style="cursor: hand;text-decoration:underline;" onclick="javascript:window.top.expandme(event);">Expand Window</a>
-- Notice:
1.This script works with
	IE6      -test OK
	NE7      -test OK
	Frames   -test OK
	EditPlus - No
	Others   -test not yet
2.This script design for use by our company site only.
  http://www.yacer.com

I'm glad to share you this.Just change something for your need,and free to use!
Wellcome to visite YACER.com!(English & Traditional Chinese version)
Any Question,please feel free mail me!
********************************************************************************************/
var winSTATE=0
var notieBAR=new Array();
function expandme(){

	saWW=window.top.screen.availWidth;
	saHH=window.top.screen.availHeight;
	otWW=top.window.outerWidth;
	otHH=top.window.outerHeight;
	scWW=window.top.screen.width;
	scHH=window.top.screen.height;
	offsetWW=top.document.body.offsetWidth;
	offsetHH=top.document.body.offsetHeight;

	if(offsetWW==saWW){
		window.top.moveTo(1,1);
		if (document.all) {
		window.top.resizeTo(saWW-1,saHH-1);
		}
		else if (document.layers||document.getElementById) {
		if (top.otHH==saHH||top.otWW==saWW){
		top.otHH = saHH-1;
		top.otWW = saWW-1;
		}
		}
	}else{
		window.top.moveTo(0,0);
		if (document.all) {
		window.top.resizeTo(saWW,saHH);
		}
		else if (document.layers||document.getElementById) {
		if (top.otHH<saHH||top.otWW<saWW){
		top.otHH = saHH;
		top.otWW = saWW;
		}
		}
	}
	//rebuild varibles
	saWW=window.top.screen.availWidth;
	saHH=window.top.screen.availHeight;
	otWW=top.window.outerWidth;
	otHH=top.window.outerHeight;
	scWW=window.top.screen.width;
	scHH=window.top.screen.height;
	offsetWW=top.document.body.offsetWidth;
	offsetHH=top.document.body.offsetHeight;
	if(winSTATE==0){
			framebarHH=scHH-saHH;
			
		   leftXX = (scWW) ? (offsetWW-scWW) : 0; 
		   topYY = (scHH) ? (offsetHH-scHH)+framebarHH : 0;
		   resizeXX=saWW-offsetWW;
		   resizeYY=saHH-offsetHH+framebarHH;
		if(document.all){
			window.top.moveBy(leftXX,topYY);
			window.top.resizeBy(resizeXX,resizeYY);
		}else if (document.layers||document.getElementById) {
		
			window.top.moveTo(0,0);
			window.top.resizeTo(saWW,saHH);
			notieBAR[0]=window.toolbar.visible;
			notieBAR[1]=window.statusbar.visible;
			notieBAR[2]=window.menubar.visible;
			notieBAR[3]=window.locationbar.visible;
			notieBAR[4]=window.personalbar.visible;

			window.toolbar.visible=false;
			window.statusbar.visible=false;
			window.menubar.visible=false;
			window.locationbar.visible=false;
			window.personalbar.visible=false;

		}
		winSTATE=1;
	}else{
		if(document.all){
			window.top.moveTo(0,0);
			window.top.resizeTo(saWW,saHH);
		}else if (document.layers||document.getElementById) {
		
			window.toolbar.visible=notieBAR[0];
			window.statusbar.visible=notieBAR[1];
			window.menubar.visible=notieBAR[2];
			window.locationbar.visible=notieBAR[3];
			window.personalbar.visible=notieBAR[4];

		}
		winSTATE=0;
	}
	return true;
}
