﻿/****************************************************************************************
'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
'     *##  *##
'     ##   ##             Copyright 2007 H & B Solutions
'    ##***##              All Rights Reserved
'   ##   ##               
' *##  *#&##**%           Authors: Hernandez, Bailey
'        ##   ##          Date:    Oct 2007
'       ##***%            Version: 1.00
'      ##    ##  
'    *##****^  Solutions
'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
*****************************************************************************************/

	var winl = ((screen.width - 800) / 2);
	var wint = ((screen.height - 800) / 2);

	/********************************************************
	** @name	rand
	** @summary	Generates a random number with limit N
	** @type	Function
	** @param	n - Inter that determines the upper random number
	** @return	A random number	
	********************************************************/
	function rand (n)
	{
	  return ( Math.floor ( Math.random ( ) * n + 1 ) );
	}//****End****

	/********************************************************
	** @name	DisplayImage
	** @summary	Selects Picture N from the Picture Array
	** @type	Funciton
	** @return	Void
	********************************************************/
	function DisplayImage()
	{
		CurrentPic = rand(3);
		document.getElementById("imgWork").src = "./img/" + Pic[CurrentPic];
	}//****End****

	/********************************************************
	** @name	OpenRemote
	** @summary	Opens the Remote picture in the Center of the user screen.
	** @type	Function
	** @param	FileName - name of the image file to send as parameter for the display file
	** @return	Void
	********************************************************/
	function OpenRemote(FileName)
	{
		var newWind=window.open("frmImage.htm?file='" + FileName + "'",'Current_Work','width=800,height=800,scrollbars=yes, resizable=yes, menubar=yes, top=' + wint + ', left=' + winl);
	}//****End****
	
	/********************************************************
	** @name	OpenWork
	** @summary	Opens the Remote picture in the Center of the user screen.
	** @type	Function
	** @param	Image - Name of the image file to send as parameter for the display file
	** @return	Void
	********************************************************/
	function OpenWork(Image){
		var newWind=window.open("frmImage.htm?file='" + Image + "'",'Current_Work','width=800,height=800,scrollbars=yes, resizable=yes, menubar=yes, top=' + wint + ', left=' + winl);
	}//****End****
	
	
	/********************************************************
	** @name	UpdateFoto
	** @summary	Loads the selected image into the screen
	** @type	Function
	** @param	Void
	** @return	Void
	********************************************************/	
	function UpdateFoto()
	{
		var Imagen;
		Imagen = eval(location.search.substring(1));
		Main.imgFoto.src = Imagen;
	}//****End****
