/* 1 July 2003 Functions for capturing Window size and restoring larer */

	var s_width;
	var s_height;
	var s_x;
	var s_y;
	
	var new_x;
	var new_y;
	var new_width = 550;   // New Screen width
	var new_height = 550;  // New Screen height
	
function capture()
{		
	 s_width = document.body.clientWidth;
 	 s_height = document.body.clientHeight;
	 s_x = document.body.screenX;
	 s_y = document.body.screenY;	
    
	//alert("Width2: " + document.body.clientWidth + "\n Height2: " + document.body.clientHeight);
	 new_x = (s_width / 2) - (new_width / 2);
	 new_x = Math.floor(new_x);
	 if (new_x < 0) {
	    new_x = 0;
	 }
	
	 new_y = (s_height / 2) - (new_height / 2);
	 new_y = Math.floor(new_y);
	if (new_y < 0) {
	   new_y = 0;
	}
	
	window.moveTo(new_x, new_y);
	//if the window size is less than 400 (indicates no window toolbar), the auto-install will resize to the new 380 by 260.
	if (s_width >= 550) {	
	    window.moveTo(new_x, new_y);
		window.resizeTo(new_width, new_height);		
	} else {
	   	new_x = (screen.width / 2) - (new_width / 2);
	    new_x = Math.floor(new_x);
	    if (new_x < 0) {
	        new_x = 0;
	    }
	
	    new_y = (screen.height / 2) - (new_height / 2);
	    new_y = Math.floor(new_y);
	    if (new_y < 0) {
	       new_y = 0;
	    }
		
	    window.moveTo(new_x, new_y);
	}
	//alert("Width3: " + document.body.clientWidth + "\n Height3: " + document.body.clientHeight);
}



function resizeBack() 
{
	//alert("Width: " + document.body.clientWidth + "\n Height: " + document.body.clientHeight);
	
	window.moveTo(s_x, s_y);
	window.resizeTo(s_width,s_height);

	s_width = s_width + 27;
	s_height = s_height + 177;

    window.moveTo(s_x, s_y);
	
	//alert("Width1: " + document.body.clientWidth + "\n Height1: " + document.body.clientHeight);
	window.resizeTo(s_width,s_height);
	
}   

// Window will only close when the close button has been clicked
function closeWin() 
{
	resizeBack();
	
	window.top.close();
}

    /*

    * This function will not return until (at least)

    * the specified number of milliseconds have passed.

    * It does a busy-wait loop.

    */

    function pause(numberMillis) {

        var now = new Date();

        var exitTime = now.getTime() + numberMillis;

        while (true) {

            now = new Date();

            if (now.getTime() > exitTime)

                return;

        }

    }



	function OpenOpf()

	{

	  var userBrowser = navigator.appName;

	  if ( ( userBrowser.indexOf( "Microsoft" ) != -1 ) && (document.FlipX)) 

	  {

		FlipX.OpenBook();

	  }

	  //checkactive();
	  //setTimeout("TimeEvent()", 20000);
	}

	function OpenOpf1()

	{

	  var userBrowser = navigator.appName;

	  if ( ( userBrowser.indexOf( "Microsoft" ) != -1 ) && (document.FlipviewerX)) 

	  {

		FlipviewerX.OpenBook();

	  }

	  //checkactive();
               //setTimeout("TimeEvent()", 20000);
	}



	function OpenOpf2()

	{

	  var userBrowser = navigator.appName;

	  if ( ( userBrowser.indexOf( "Microsoft" ) != -1 ) && (document.FVLiteX)) 

	  {

		FVLiteX.OpenBook();

	  }

	  //checkactive();
	  //setTimeout("TimeEvent()", 20000);
	}

	/***

		Checks if ActiveX object is available to close

			or use normal Javascript Close script.

		11 Jul 02 hsn - Added a back button feature if popup opens on existing window.		

	

	***/

    function TimeEvent()
    {
       checkactive();
    }

	function checkactive( type )
    {

	   //pause( 5000);
    	 if (history.length > 0 ) {

				//alert( "Going Back!");
				history.go(-1);
		}

		else {

//				alert( "Going to close");
                //resizeBack();
    // Disable Win close for Korean Version - 2 Jan 2003
	//			window.close();

				if ( close == "yes" ) {	
	
					if ( (document.closeWin) && ( closeWin.object !=null ) ) 
	
					{
	
							closeWin.Click();
	
					}
	
					else
	
					{
						//hsn - 08 Oct 2002
						// Check if Popped from another browser or by Javascript
						// in reference to taking out HhCtrl ActiveX to close Window
						// Now will not close if last browser.
						
						//alert( window.opener) ;
	
						if ( window.opener !=  null  ) { // from a parent
						
	    // Disable Win close for Korean Version - 2 Jan 2003					
		//					self.close();
		
						}
						// else do not close.
	
					}
				}

			}

		

	}

	   

function refresh()

{

    //  This version does NOT cause an entry in the browser's

//  page view history.  Most browsers will always retrieve

//  the document from the web-server whether it is already

//  in the browsers page-cache or not.

//  

//window.location.replace( sURL );

window.location.reload( );

//alert( sURL ) ;



}



var sURL = unescape(window.location);




