function detectVersion()
{ 
version = parseInt(navigator.appVersion);
return version; 
} 

function detectOS()
{ 
if(navigator.userAgent.indexOf('Win') == -1) {
OS = 'Macintosh'; 
} else { 
OS = 'Windows'; 
} 
return OS; 
} 

function detectBrowser()
{ 
if(navigator.appName.indexOf('Netscape') == -1) {
browser = 'IE'; 
} else { 
browser = 'Netscape';
} 
return browser; 
} 

function FullScreen(link){

var adjWidth; 
var adjHeight; 

if((detectOS() == 'Macintosh') && (detectBrowser() == 'Netscape'))
{ 
adjWidth = 0; 	//	con 20 sale cortado en safari (Mac)
adjHeight = 0; // 	35, con 0 sale igual?????????????????????????????????????????
} 
if((detectOS() == 'Macintosh') && (detectBrowser() == 'IE'))
{ 
adjWidth = 0; 
adjHeight = 0; 
} 
if((detectOS() == 'Windows') && (detectBrowser() == 'Netscape'))	// Firefox tb!
{ 		//	alert ("firefox");
adjWidth = 0;	//	con 30 sale cortado en firefox 
adjHeight = 30; //	con 0 sale igual, no tapa la barra de tareas
} 
if(detectVersion() < 4)
{ 
self.location.href = link; // non4browsers, para navegadores antiguos
} 
// _________________________________
// The following is the added bit which recognises the Mac IE browser
// and moves and resizes it to fit the whole screen you can play around
// with the numbers in the line: maciewindow.resizeTo(screen.width -10,screen.height - 45);
// which will change the size slightly
// __________________________________
if((detectOS() == 'Macintosh') && (detectBrowser() == 'IE'))
{
var maciewindow = window.open(link, 'popup','fullscreen=yes');
maciewindow.moveTo(0,0);
maciewindow.resizeTo(screen.width - 10,screen.height - 45);
maciewindow.focus();
}
else
{ 
var winWidth = screen.width - adjWidth;
var winHeight = screen.height - adjHeight;
var winSize = 'width=' + winWidth + ',height=' + winHeight;
var thewindow = window.open(link, 'popup', winSize);
thewindow.moveTo(0,0);
thewindow.focus();
} 
} 

function MakeItSo(link){	
			width=screen.width;height=screen.height;	// .Height y .Width minúsculas!! o no en FF e IE8? 
			availwidth=screen.availWidth;availheight=screen.availHeight;
		//	alert("SO: "+detectOS()+"\nNavegador: "+detectBrowser()+"\nwidth: "+width+"\nheight: "+height+"\navailwidth: "+availwidth+"\navailheight: "+availheight);
if((detectOS() == 'Windows') && (detectBrowser() == 'IE')) {	// Fullscreen?
//ventana=window.open(link,'popup','fullscreen=yes', 'scrollbars=no', 'menubar=yes');
//ventana=window.open(link,'popup','fullscreen=no', 'scrollbars=no', 'menubar=yes', 'width=screen.Width,height=screen.Height'); // NO!
  ventana=window.open(link,'popup','fullscreen=no', 'scrollbars=no', 'menubar=yes');
  ventana.moveTo(0,0);

	if (width==undefined) {
		ventana.resizeTo (availwidth,availheight); // Pa IE8 TB necesita el MoveTo antes
	} else {
//		ventana.resizeTo (width,height); 			// NO FUNCIONA BIEN! sin el moveTo antes!	Funciona fatal en IE8! (undefineds!)
		ventana.resizeTo (availwidth,availheight);	// Mejor así siempre? sólo sale fullscreen en IE6 SP1?
	}
//	alert("Windows IE");
ventana.focus();
} else { 
onload=FullScreen(link);
} 
} 
