//**********************************
//This function will change the 
//class for the element that 
//is passed into it
//**********************************
function changeClass(id) 
{
	try
	{
		// Specify the tab array
		var TABS = new Array();
			TABS[0] = "tabFrance";
			TABS[1] = "tabItaly";
			TABS[2] = "tabUKIreland";
			TABS[3] = "tabPraque";
			TABS[4] = "tabNorthAmerica";
			TABS[5] = "tabPortugal";
			TABS[6] = "tabGreece";
			TABS[7] = "tabSpain";
			
		//reset all the tabs
		for(var i=0; i<TABS.length; i++) 
		{
			tab = document.getElementById(TABS[i]);
			if(tab)
			{
				tab.className = "";
			}
		}
		
		//set active tab passed in	
		element=document.getElementById(id);
		element.className="active";
	}
	catch(err)
	{}
}

//****************************************
//This will open up according 
//to what we pass 
//into it
//****************************************
var win= null;
function ShowImages(vPage, vProperty, vWidth, vHeight)
{
	try
	{
		var vURL = vPage + "?field=" + vProperty;
		OpenModal('GalleryViewer', vURL, vWidth, vHeight);
	}
	catch(err)
	{}	
}

//**************************************
//Check for pop up blocker
//**************************************
function IsPopupBlocker(page, h, w, winname) 
{
	try
	{
			var nHeight = h;
			var nWidth = w;
			var nXpos = (screen.availWidth - nWidth) / 2;
			var nYpos = 0;
				win = window.open(page, winname,'top=' + nYpos + ',left=' + nXpos +	',screenY=' + nYpos + ',screenX=' + nXpos +	',height=' + nHeight + ',width=' + nWidth +',toolbar=no,menubar=no,status=no,location=no,scrollbars=yes,resizable=no');
			if(parseInt(navigator.appVersion) >= 4){win.focus();}
				
			if (win==null || typeof(win)=="undefined") 
			{
				return true;
			} 
			else 
			{
				return false;
			}
	}
	catch(err)
	{}
}

//**********************************
//Open window
//**********************************
function OpenParisNight()
{
	try
	{
			var nHeight =screen.height-100;
			var nWidth = screen.width;
			var nXpos = 0;
			var nYpos =0;
			var page = 'http://framboise781.free.fr/Paris.htm';
			var winname = 'ParisAtNight';
				win = window.open(page, winname,'top=' + nYpos + ',left=' + nXpos +	',screenY=' + nYpos + ',screenX=' + nXpos +	',height=' + nHeight + ',width=' + nWidth +',toolbar=no,menubar=no,status=yes,location=no,scrollbars=yes,resizable=yes');
			if(parseInt(navigator.appVersion) >= 4){win.focus();}
	}
	catch(err)
	{}
}

//**************************************
//open new window function
//**************************************
function OpenWindow(url, width, height)
{
	var opts = "alwaysRaised=yes,dependent=yes,status=no,toolbar=no,titlebar=no,scrollbars=yes,resizable=yes";
	if(width) 
	{
		opts+=", width = "+width.toString();
	}
	
	if(height)
	{
		 opts+=",height="+height.toString();
	}
		return window.open(url,'later',opts);
}

//**************************************
//open modal window
//**************************************
function OpenModal(title, url, width, height)
{
	var opts = "";
	if(width)
	{
		opts+="dialogWidth:" + width.toString() + "px;";
	}
	
	if(height) 
	{
		opts+="dialogHeight:" + height.toString() + "px;";
	}
		opts = opts + "statusbar:no;minimize:no;maximize:no;border:thin;status:no;center:yes;help:no";
	
	return window.showModalDialog(url, window, opts);
}