function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function HomeMenuItem(Page)
{
	if (Page == "home" || Page == "" || Page == "success")
	{
		return '<a href="index.php?ca=home" onMouseOver="MM_swapImage(\'Image1\',\'\',\'images/home2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/home2.gif" name="Image1" width="81" height="32" border="0"></a>';
	}
	else
	{ 
		return '<a href="index.php?ca=home" onMouseOver="MM_swapImage(\'Image1\',\'\',\'images/home2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/home1.gif" name="Image1" width="81" height="32" border="0"></a>';
	}
}

function DiamondsMenuItem(Page)
{
	if (Page == "diamonds" || Page == "diamondsretailers" || Page == "diamonforsale" || Page == "diamonquality")
	{
		return  '<a href="index.php?ca=diamonds" onMouseOver="MM_swapImage(\'Image2\',\'\',\'images/diamonds2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/diamonds2.gif" name="Image2" width="103" height="32" border="0"></a>';
	}
	else
	{
		return '<a href="index.php?ca=diamonds" onMouseOver="MM_swapImage(\'Image2\',\'\',\'images/diamonds2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/diamonds1.gif" name="Image2" width="103" height="32" border="0"></a>';
	}
}

function FashionMenuItem(Page)
{
	if (Page != "fashion")
	{
		return '<a href="index.php?ca=fashion" onMouseOver="MM_swapImage(\'Image3\',\'\',\'images/fashion2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/fashion1.gif" name="Image3" width="90" height="32" border="0"></a>';
	}
	else
	{
		return '<a href="index.php?ca=fashion" onMouseOver="MM_swapImage(\'Image3\',\'\',\'images/fashion2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/fashion2.gif" name="Image3" width="90" height="32" border="0"></a>';
	}
}

function JewelleryMenuItem(Page)
{						   
	if (Page == "jewellery" ||
		Page == "dfjdiamond" ||
		Page == "snoofsweden" ||
		Page == "murano" ||
		Page == "theroyalgracecollection" ||
		Page == "muranoretailers" || 
		Page == "dfjdisplay" || 
		Page == "silver" ||
		Page == "dfjdisplayretailers" ||
		Page == "snoofswedenretailers")
	{
		return '<a href="index.php?ca=jewellery" onMouseOver="MM_swapImage(\'Image4\',\'\',\'images/jewellery2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/jewellery2.gif" name="Image4" width="102" height="32" border="0"></a>';
	}
	else
	{
		return '<a href="index.php?ca=jewellery" onMouseOver="MM_swapImage(\'Image4\',\'\',\'images/jewellery2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/jewellery1.gif" name="Image4" width="102" height="32" border="0"></a>';
	}
}

function LinariMenuItem(Page)
{
	if (Page == "linari")
	{
		return '<a href="index.php?ca=linari" onMouseOver="MM_swapImage(\'Image5\',\'\',\'images/linari2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/linari2.gif" name="Image5" width="108" height="32" border="0"></a>';
	}
	else
	{
		return '<a href="index.php?ca=linari" onMouseOver="MM_swapImage(\'Image5\',\'\',\'images/linari2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/linari1.gif" name="Image5" width="108" height="32" border="0"></a>';
	}
}

function ShopMenuItem(Page)
{
	if (Page == "linari")
	{
		return '<a href="http://www.dfj.fi/shop/shop.php" onMouseOver="MM_swapImage(\'Image6\',\'\',\'images/shop2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/shop2.gif" name="Image6" width="81" height="32" border="0"></a>';
	}
	else
	{
		return '<a href="http://www.dfj.fi/shop/shop.php" onMouseOver="MM_swapImage(\'Image6\',\'\',\'images/shop2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/shop1.gif" name="Image6" width="81" height="32" border="0"></a>';
	}
}

function Menu(Page)
{
	document.write(HomeMenuItem(Page) + 
				   DiamondsMenuItem(Page) + 
				   FashionMenuItem(Page) + 
				   JewelleryMenuItem(Page) +
				   LinariMenuItem(Page));
}

function ReloadLeftContent(Page)
{
	var Url = "";
	if (window.location.href.indexOf("http://www.dfj.fi") == 0)
	{
		Url = "http://www.dfj.fi/leftcontent.php?ca=left" + Page;
	}
	else
	{
		Url = "http://dfj.fi/leftcontent.php?ca=left" + Page;
	}
	
	XmlHTTP.open("GET", Url, true);
	XmlHTTP.onreadystatechange=function() 
	{
		if (XmlHTTP.readyState ==4)  
		{
			document.getElementById("left_content").innerHTML = XmlHTTP.responseText;
		}	
	}
	XmlHTTP.send(null);
}

function GetPage()
{
	var Page = window.location.search.substring(4);
	return (Page != "home" && 
			Page != "diamonds" && 
			Page != "fashion" && 
			Page != "jewellery" &&
			Page != "dfjdiamond" &&
			Page != "snoofsweden" &&
			Page != "murano" &&
			Page != "theroyalgracecollection" &&
			Page != "silver" &&
			Page != "linari" &&
			Page != "diamonquality" &&
			Page != "diamonforsale" &&
			Page != "muranoretailers" && 
			Page != "success" &&
			Page != "dfjdisplay" &&
			Page != "diamondsretailers" &&
			Page != "dfjdisplayretailers" &&
			Page != "snoofswedenretailers") ? "home" : Page;
}

var XmlHTTP = false;

if (!XmlHTTP && typeof XMLHttpRequest!='undefined') 
{
	try 
	{
		XmlHTTP = new XMLHttpRequest();
	} 
	catch (e) 
	{
		XmlHTTP=false;
	}
}

if (!XmlHTTP && window.createRequest) 
{
	try 
	{
		XmlHTTP = window.createRequest();
	} 
	catch (e) 
	{
		XmlHTTP=false;
	}
}

if (!XmlHTTP && window.ActiveXObject) 
{
	try 
	{
		XmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
	} 
	catch (e) 
	{
		XmlHTTP=false;
	}
}