//Function: LoadMessageBanner
//Purpose: Loads a random string that can be HTML formatted into a table Cell with the ID MessageBannerCell.
//Usage: Define the table cell like this <td align="center" id="MessageBannerCell">
//		And call the function when the page loads by adding the OnLoad event to the body tag like this
//		<body onload="LoadMessageBanner();">
//Define the array of messages here. Make sure any text you include fits in a single line and single quotes are escaped by \'
ArrayMessages = new Array(
	'Ayudando a la industria de la construcción y al mueblista a encontrar todo lo que necesita <br>en Cuernavaca y sus alrededores.',
	'Con centro de servicios adecuado especialmente a las necesidades de trabajo en la fabricación de muebles,<br> con asesoría técnica especializada. Optimización de corte, Dimensionado, Centro de diseño.',
	'Amplia variedad de productos:<br>tableros de pino, ayacahuitle, conglomerado, MDF, OSB;<br> puertas de tambor y persiana; molduras, accesorios ...'
);
function LoadMessageBanner()
{
	var MsgBannerCell = document.getElementById('MessageBannerCell');
	if (MsgBannerCell)
	{
		MsgBannerCell.innerHTML = ArrayMessages[Math.floor((Math.random()*100)%ArrayMessages.length)];
		//MsgBannerCell.innerHTML = '' + Math.floor((Math.random()*100)%ArrayMessages.length);
	}
}

//Function: AWGoTo
//Purpose: Navigate to strURL.
//Usage: <TD OnClick="return AWGoTo('about.html');" style='cursor: pointer'>Some text</TD>
function AWGoTo(strURL)
{
	document.location.href = strURL;
	return false;
}

//Global variable for Window handle.
var win=null;
//Function: NewWindow
//Purpose: Open a pop-up window with specified "name" (to be reused if already open), width (w), height (h) and whether or not it has scrollbars (possible values are yes, no or auto)
//Remarks: This function will open a new window centered on the screen with no Toolbar, location (address) bar, status bar, menubar and will not be resizeable.
//Usage examples: <TD OnClick="NewWindow('http://groups.yahoo.com/group/ActiveWords/','AWYahooGroups','720','560','auto');" style='cursor: pointer'>Some text</TD>
//	<A href="javascript:void(NewWindow('http://groups.yahoo.com/group/ActiveWords/','AWYahooGroups','720','560','auto'))">The link text</A>
function NewWindow(mypage,myname,w,h,scroll)
{
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no'
	win=window.open(mypage,myname,settings)
	if(parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

//Function: NewWindow2
//Purpose: Open a pop-up window with specified "name" (to be reused if already open), width (w), height (h) and whether or not it has scrollbars (possible values are yes, no or auto)
//Remarks: This function will open a new window centered on the screen with Toolbar, location (address) bar, status bar, menubar and will be resizeable.
//Usage examples: <TD OnClick="NewWindow('http://groups.yahoo.com/group/ActiveWords/','AWYahooGroups','720','560','auto');" style='cursor: pointer'>Some text</TD>
//	<A href="javascript:void(NewWindow('http://groups.yahoo.com/group/ActiveWords/','AWYahooGroups','720','560','auto'))">The link text</A>
function NewWindow2(mypage,myname,w,h,scroll)
{
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes,dependent=no'
	win=window.open(mypage,myname,settings)
	if(parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
}

function popup_window(url, id, width, height)
{
	popup = window.open(url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=' + width + ',height=' + height + '');
	popup.focus();
}


