
function set_main_image(idx)
{
	var image_collection = Array("/image.php?g=795699f1-552d-eb56-745c-6e58ce01056b", "/image.php?g=75251ec0-1d30-33b0-aca7-81b27b6a98b4", "/image.php?g=f040407d-0ce7-dbed-2b9a-4888ce73ea1b", "/image.php?g=9eb3dafa-393f-3266-5979-d4339ff53579", "/image.php?g=2cbffeb2-ab76-7206-a30d-eee9ac3731f5", "/image.php?g=733ad9f4-7453-1256-a58e-172c2a7cf38f");

	if (img = document.getElementById('mainImage'))
	{
		img.src = image_collection[idx] + '&of=1';
	}

	for (i = 0; i < image_collection.length; i++)
	{
		if (img = document.getElementById('thumbNail' + i))
		{
			img.className = (i == idx)? "selected" : null;
		}
	}
}

function advert_tabs_set_tab(tab, tabName, divClass)
{
	var i = 0;
	var tr = tab.parentNode;
	for (var j = 0; j < tr.childNodes.length; j++)
	{
		if (tr.childNodes[j].className && (tr.childNodes[j].className != "tab last"))
		{
			td = tr.childNodes[j];
			td.className = "tab" + ((td == tab)? " selected" : "");

			if (div = document.getElementById(tabName + '_' + i))
			{
				div.className = divClass + ((td == tab)? " selected" : "");
			}
			i++;
		}
	}
}

function advert_tabs_select(tabId, caption, body)
{
	if (td = document.getElementById('td_' + caption + '_' + tabId))
	{
		advert_tabs_set_tab(td, caption, "caption");
	}
	if (td = document.getElementById('td_' + body + '_' + tabId))
	{
		advert_tabs_set_tab(td, body, "body");
	}
}




/*
 Microsoft Virtual Earth
 */

var map = null;
var point = null;
var mapContainer = 'mapContainer';

function EventMouseWheel(e)
{
   //insert custom behavior here...
   //return true to disable the default behavior. return false to enable the default behavior.
	window.scrollBy(0,-1*e.mouseWheelChange);
  	return true;
}

function init_ve_map()
{
	// create a new map
	map = new VEMap(mapContainer);

	// set dashboard size
	map.SetDashboardSize(VEDashboardSize.Small);

	// get map style
	version_info = VEMap.GetVersion().split('.');
	map_style = (version_info[2] >= 20070400000000)? VEMapStyle.Shaded : VEMapStyle.Road;

	// initialize map
	map.LoadMap(point, 10, map_style, false, VEMapMode.Mode2D, false);

	// Disable mouse wheel
       map.AttachEvent("onmousewheel", EventMouseWheel);

	// create new marker
	var marker = new VEShape(VEShapeType.Pushpin, point);
	marker.SetCustomIcon('<img src="./images/map/house.gif" alt="" style="margin: 5px 0px 0px 7px;" />');
	
	// add marker
	map.AddShape(marker);

	map.AttachEvent("onmouseover", function(e) {if (e.elementID != null) {return true;}});
	map.AttachEvent("onmouseout", function(e) {if (e.elementID != null) {return true;}});

	// hide elements of the map
	if (div = document.getElementById(mapContainer))
	{
		var nodes = div.getElementsByTagName("div");
		
		for (i = 0; i < div.childNodes.length; i++)
		{
			var child = div.childNodes[i];

			if ((child.className != null) && (
			 (child.className.indexOf("MSVE_Scale") == 0) || 
			 (child.className.indexOf("MSVE_Powered") == 0) ||
				(child.className.indexOf("MSVE_Copyright") == 0)))
			{
				child.style.display = "none";
			}
		}
	}

}