function MM_swapImgRestore()
{
}
function MM_preloadImages() {
  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 checkKey(evt)
{
	version=0
	if (navigator.appVersion.indexOf("MSIE")!=-1)
	{
		temp=navigator.appVersion.split("MSIE");
		version=parseFloat(temp[1]);
	}
	if (version>=6.0)
	{
		if (window.event.keyCode == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			document.location.href="Search.aspx?artist=&edition=&color=&design=&subject=&room=&orientation=&key="+document.getElementById("ctl00_mnuHeader_TxtOquiksearch").value;
		}
	}
	else
	{
		var key = (window.Event) ? evt.which : evt.keyCode;
		if (key == 13)
		{
			document.location.href="Search.aspx?artist=&edition=&color=&design=&subject=&room=&orientation=&key="+document.getElementById("ctl00_mnuHeader_TxtOquiksearch").value;
		}
	}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) {
  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()
{
}
function LoadMenucss()
{
	strlocation=document.URL;
   	strCurr=strlocation.substring(strlocation.lastIndexOf("/")+1,strlocation.length);
   	strVideo = strlocation.substring(strlocation.indexOf("?")+1,strlocation.length).toLowerCase();
   	strCurrPage=strCurr.substring(0,strCurr.lastIndexOf(".")).toLowerCase();
	var a = document.getElementsByTagName("a");
	for(var i=0; i < a.length; i++)
	{
		if (a[i].name != 'video' && a[i].name == strCurrPage)
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if ((strVideo=='value=size&ply=y' || strVideo=='value=size' || strVideo=='value=gic&ply=y' || strVideo=='value=gic' || strVideo=='value=amo&ply=y' || strVideo=='value=amo') && a[i].name == 'video')
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if (strCurrPage=='framerselection' && a[i].name == 'selectframer')
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if ((strCurrPage=='search') && (a[i].name == 'browseartwork'))
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if ((strCurr=='Video.aspx?value=day&ply=y' || strCurr=='Video.aspx?value=day') && a[i].name == 'videoday')
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if (strCurrPage=='glossaryofterms' && a[i].name == 'video')
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if ((strCurrPage=='ourstory' || strCurrPage=='faq'  || strCurrPage=='contactus') && a[i].name == 'ourstory')
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if (strCurr=='Video.aspx' && a[i].name == 'video')
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
		if ((strCurr=='Gallery_Login.aspx' || strCurr=='mygallery.aspx') && a[i].name == 'gallerylogin')
		{
			a[i].style.color = "#ffffff";
			a[i].style.background = "#c6101c";
		}
	}
}
function DropDownHeight()
{
	version=0
	if (navigator.appVersion.indexOf("MSIE")!=-1)
	{
		temp=navigator.appVersion.split("MSIE");
		version=parseFloat(temp[1]);
	}
	if (version>=7.0)
	{
		var e=document.getElementById('LJMainDiv').getElementsByTagName('*');
		for (var i=0;i<e.length;i++)
		{
			if (e[i].id.substr(0,39)=='ctl00_ContentPlaceHolder1_dtlImages_ctl' && e[i].id.substr(41,9)=='_SelRLink' || e[i].id.substr(41,10)=='_SelRLink1' || e[i].id.substr(0,33)=='ctl00_mnuleftnavigator_SelOArtist' || e[i].id.substr(0,34)=='ctl00_mnuleftnavigator_SelOSubject' || e[i].id.substr(0,32)=='ctl00_mnuleftnavigator_SelOColor' || e[i].id.substr(0,35)=='ctl00_mnuleftnavigator_SelOInterior' || e[i].id.substr(0,32)=='ctl00_mnuleftnavigator_SelOColor' || e[i].id.substr(0,32)=='ctl00_mnuleftnavigator_SelOColor' || e[i].id.substr(0,38)=='ctl00_mnuleftnavigator_SelOOrientation' || e[i].id.substr(0,41)=='ctl00_mnuleftnavigator_SelRState_Province' || e[i].id.substr(0,34)=='ctl00_mnuleftnavigator_SelRCountry')
			{
				document.getElementById(e[i].id).style.height='18px';
			}
		}
	}
}
function clearPreloadPage()
{
    strlocation=document.URL;
    strCurr=strlocation.substring(strlocation.lastIndexOf("/")+1,strlocation.length);
    strCurrPage=strCurr.substring(0,strCurr.lastIndexOf(".")).toLowerCase();
    if (strCurrPage=='search')
    {
    }
    if (document.getElementById)
    {
        document.getElementById('prepage').style.visibility='hidden';
    }
    else
    {
        if (document.layers)
        { //NS4
            document.prepage.visibility = 'hidden';
        }
        else
        { //IE4
         document.all.prepage.style.visibility = 'hidden';
        }
    }
}
function IncludeStyles()
{
	if (navigator.appVersion.indexOf('Mac') != -1)
		document.write('<link rel="stylesheet" href="styles/newstyleMac.css" type="text/css">');
	else if (navigator.appVersion.indexOf('Netscape') != -1)
		document.write('<link rel="stylesheet" href="styles/newstyleFF.css" type="text/css">');
	else if (navigator.userAgent.indexOf("Firefox") != -1)
		document.write('<link rel="stylesheet" href="styles/newstyleFF.css" type="text/css">');
	else
		document.write('<link rel="stylesheet" href="styles/newstyle.css" type="text/css">');
}
function ApplyPageStyle()
{
	strlocation=document.URL;
	strCurr=strlocation.substring(strlocation.lastIndexOf("/")+1,strlocation.length);
	strCurrPage=strCurr.substring(0,strCurr.lastIndexOf(".")).toLowerCase();
	if (strCurrPage == 'browseartwork')
		document.write('<link rel="stylesheet" href="browseartworkstyle.css" type="text/css">');
	else if (strCurrPage == 'browseartists')
		document.write('<link rel="stylesheet" href="browseartists.css" type="text/css">');
	else if (strCurrPage == 'customsizingpage')
		document.write('<link rel="stylesheet" href="CustomSizingPage.css" type="text/css">');
	else if (strCurrPage == 'video')
		document.write('<link rel="stylesheet" href="Video.css" type="text/css">');
	else if (strCurrPage == 'viewcart')
		document.write('<link rel="stylesheet" href="ViewCart.css" type="text/css">');
	else if (strCurrPage == 'mygallery' || strCurrPage == 'framerselection')
		document.write('<link rel="stylesheet" href="PagenationStyle.css" type="text/css">');
}
