﻿
function openWindow( u,ta,x,y,w,h,st,sc,to,m,l,res,dir,fav,rep,fullsc )
{
	var url        = u   ; // URL
	var target     = ta  ; // Target Window
	var left       = ( x != null ) ? x : ( screen.availWidth  - w ) / 2 ; // Window x-position
	var top        = ( y != null ) ? y : ( screen.availHeight - h ) / 2 ; // Window y-position
	var width      = w   ; // window width
	var height     = h   ; // window height
	var status     = st  ; // status bar
	var scrollbar  = sc  ; // scrollbar
	var toolbar    = to  ; // toolbar
	var menubar    = m   ; // menubar
	var location   = l   ; // location bar
	var resizable  = res ; // resizable?
	var directorie = dir ; // directories
	var favorite   = fav ; // favourite
	var replace    = rep ; // window.replace("")
	var fullscreen = fullsc ; // fullscreen

	if ( width > screen.availWidth )
	{
		width = screen.availWidth -50 ;
	}

	if ( height > screen.availHeight )
	{
		height = screen.availHeight -85 ;
	}

	var features = "status=" + status + ",scrollbars=" + scrollbar + ",toolbar=" + toolbar + ",location=" +location + ",menubar=" + menubar + ",resizable=" + resizable + ",left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",directories=" + directorie + ",favorites=" + favorite + ",fullscreen=" + fullscreen ;
//alert(features);
	newWin = window.open ( url, target, features, replace ) ;
	newWin.focus();	
}

function openNewWindow( pageURL )
{
	if ( pageURL )
	{
		openWindow( pageURL,'myNewWindow',null,null,800,600,'yes','yes','yes','yes','yes','yes','yes','yes','yes' ) ;
	}
}

function openFullScreen2( myURL )
{
	var width = screen.availWidth ;
	var height = screen.availHeight ;

	openWindow( myURL,'myNewWindow',0,0,width,height,'no','no','no','no','no','no','no','no','no','yes' ) ;
}