// preload images
// simplePreload( '01.gif', '02.gif' );
function simplePreload(){
  	 var args = simplePreload.arguments;
  	 document.imageArray = new Array(args.length);
  	 for(var i=0; i<args.length; i++)
  	 {
    	 document.imageArray[i] = new Image;
    	 document.imageArray[i].src = args[i];
  	 }
}
	 
// switch images
// switchImage( 'nomeImg', '01.gif' );
function switchImage(imgName, imgSrc){
	if (document.images){
		if (imgSrc != ''){
		 document.images[imgName].src = imgSrc;
		}
	}
}

function MM_openBrWindow(theURL,winName,features){
  window.open(theURL,winName,features);
}

function returnSelection(radioButton) {
	var selection=null;
	for(var i=0; i<radioButton.length; i++) {
		 if(radioButton[i].checked) {
		   selection=radioButton[i].value;
		   return selection;
		 }
	}
	return selection; 
} 

// function open pop-up
// openWindow('urlPage', 'namePopup', 'width', 'height', 'yes/no');
function openWindow(mypage,myname,w,h,resizable){ 
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
	settings = 'resizable='+resizable+',height='+h+',width='+w+',scrollbars=yes,top='+TopPosition+',left='+LeftPosition;
	win = window.open(mypage,myname,settings) 
	if(win.window.focus){
		win.window.focus();
	} 
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}
