var imgPath = "mmPPA"; /** uncomment for LIVE SERVER **/
//var imgPath = "mmASC"; /** uncomment for TEST SERVER **/

function writeZoomifyFlash(path)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="378" HEIGHT="378" ID="theMovie">');
	document.write('<param name="FlashVars" VALUE="zoomifyImagePath=zoomify/'+path+'/&zoomifyX=0.0&zoomifyY=0.0&zoomifyZoom=-1&zoomifyToolbar=1&zoomifyNavWindow=1&zoomifyNavWindow=1&zoomifyNavX=18&zoomifyNavY=277&zoomifyNavWidth=80&zoomifyNavHeight=80">');
	document.write('<param name="src" VALUE="zoom/zoomifyDynamicViewer.swf">');
	document.write('<embed FlashVars="zoomifyImagePath=zoomify/'+path+'&zoomifyX=0.0&zoomifyY=0.0&zoomifyZoom=-1&zoomifyToolbar=1&zoomifyNavWindow=1&zoomifyNavWindow=1&zoomifyNavX=18&zoomifyNavY=277&zoomifyNavWidth=80&zoomifyNavHeight=80" SRC="zoom/zoomifyDynamicViewer.swf" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  WIDTH="375" HEIGHT="375" NAME="theMovie" />');
	document.write('</object>');
}

function writeZoomifyFlash2(path)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="378" HEIGHT="378" ID="theMovie">');
	document.write('<param name="FlashVars" VALUE="zoomifyImagePath=zoomify/'+path+'/&zoomifyX=0.0&zoomifyY=0.0&zoomifyZoom=-1&zoomifyToolbar=1&zoomifyNavWindow=1&zoomifyNavWindow=1&zoomifyNavX=18&zoomifyNavY=277&zoomifyNavWidth=80&zoomifyNavHeight=80">');
	document.write('<param name="src" VALUE="zoom/zoomifyDynamicViewer.swf">');
	document.write('<embed FlashVars="zoomifyImagePath=zoomify/'+path+'&zoomifyX=0.0&zoomifyY=0.0&zoomifyZoom=-1&zoomifyToolbar=1&zoomifyNavWindow=1&zoomifyNavWindow=1&zoomifyNavX=18&zoomifyNavY=277&zoomifyNavWidth=80&zoomifyNavHeight=80" SRC="zoom/zoomifyDynamicViewer.swf" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  WIDTH="375" HEIGHT="375" NAME="theMovie" />');
	document.write('</object>');
}

function writePlaceArt(path,width,height)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="760" height="560" id="placeart" align="middle">');	
	document.write('<param name="allowScriptAccess" value="sameDomain" />');	
	document.write('<param name="movie" value="flash/placeart.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');	
	document.write('<param name="FlashVars" value="artPath=/'+imgPath+'/Images/'+path+'&imgPath=images/&xmlPath=xml/&artHeight='+height+'&artWidth='+width+'" />');	
	document.write('<embed src="flash/placeart.swf" FlashVars="artPath=/'+imgPath+'/Images/'+path+'&imgPath=images/&xmlPath=xml/&artHeight='+height+'&artWidth='+width+'" quality="high" bgcolor="#ffffff" width="760" height="560" name="placeart" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');	
	document.write('</object>');
}

function writeNewArtShowCase(path,cartId)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="760" height="560" id="placeart" align="middle">');	
	document.write('<param name="allowScriptAccess" value="sameDomain" />');	
	document.write('<param name="movie" value="flash/showcase.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');	
	document.write('<param name="FlashVars" value="artPath=/'+imgPath+'/Images/'+path+'&imgPath=/'+imgPath+'/Images/&xmlPath=xml/&cartID='+cartId+'" />');	
	document.write('<embed src="flash/showcase.swf" FlashVars="imgPath=/'+imgPath+'/Images/&xmlPath=xml/&cartID='+cartId+'" quality="high" bgcolor="#ffffff" width="760" height="560" name="placeart" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');	
	document.write('</object>');
}

function writeArtGuide(cartId)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="560" height="400" id="artguide" align="middle">');	
	document.write('<param name="allowScriptAccess" value="sameDomain" />');	
	document.write('<param name="movie" value="flash/guidedtour.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');	
	document.write('<param name="FlashVars" value="imgPath=/'+imgPath+'/Images/&xmlPath=xml/&cartID='+cartId+'" />');	
	document.write('<embed src="flash/guidedtour.swf" FlashVars="imgPath=/'+imgPath+'/Images/&xmlPath=xml/&cartID='+cartId+'" quality="high" bgcolor="#ffffff" width="550" height="400" name="artguide" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');	
	document.write('</object>');
}


function writeFlashBanner(cartId)
{

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="170" id="home2" align="middle">');
			document.write('<param name="allowScriptAccess" value="sameDomain" />');
			document.write('<param name="movie" value="flash/home.swf" />');
			document.write('<param name="quality" value="high" />');
			document.write('<param name="bgcolor" value="#ffffff" />');
			document.write('<param name="menu" value="false">');
			document.write('<embed src="flash/home.swf" quality="high" width="550" height="170" menu="false" name="home" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');

}

function writeWhatsHot(cartId)
{

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="170" id="home2" align="middle">');
			document.write('<param name="allowScriptAccess" value="sameDomain" />');
			document.write('<param name="movie" value="flash/whatshot.swf" />');
			document.write('<param name="quality" value="high" />');
			document.write('<param name="bgcolor" value="#ffffff" />');
			document.write('<param name="menu" value="false" />');
			document.write('<param name="FlashVars" value="xmlPath=xml/&amp;imgPath=/mmPPA/Images/">');
			document.write('<embed src="flash/whatshot.swf" width="550" height="170" quality="high" menu="false" name="home" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" flashvars="xmlPath=xml/&amp;imgPath=/mmPPA/Images/" />');
		document.write('</object>');
}





function writeIntroducingArtevo(cartId)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="550" HEIGHT="340" ID="aboutArtevo">');
	document.write('<param name="FlashVars" value="xmlPath=xml/&flvPath=flv/&cartID='+cartId+'" />');
	document.write('<param name="src" VALUE="flash/about_artevo.swf">');
	document.write('<embed FlashVars="xmlPath=xml/&flvPath=flv/&cartID='+cartId+'" SRC="flash/about_artevo.swf" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  WIDTH="550" HEIGHT="340" name="aboutArtevo" />');
	document.write('</object>');	
}

function writeArtevoExperience()
{
    document.write('<object width="480" height="340" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="https://www.apple.com/qtactivex/qtplugin.cab">\n');
	document.write('<param name="src" value="../mov/teaser.mov">\n');
	document.write('<param name="autoplay" value="true">\n');
	document.write('<param name="controller" value="true">\n');
	document.write('<embed src="../mov/teaser.mov" width="480" height="340" autoplay="true" controller="true" loop="false" pluginspage="https://www.apple.com/quicktime/download/"></embed>\n');
	document.write('</object>\n');
}

function checkZoom()
{
		if(getURLParam("closer") == 't')
			zoomImageSwap('zoom');
		else
		{
			if(document.getElementById('dm_closer2') != null)
				zoomImageSwap('zoomout');
		}
}

function zoomImageSwap(type)
{
	if(type == 'zoom') // Show Zoomify div
	{
		document.getElementById('zoomImg').style.display = 'block'; // Show the Zoomify div
		document.getElementById('prodImg').style.display = 'none';	// Hide the Image div
		
		document.getElementById('zoomifyLink').style.display = 'none'; // Hide the Closer Look button
		document.getElementById('productImageLink').style.display = 'block'; // Show the Product Image button
	}
	else if(type == 'zoomout')
	{
		document.getElementById('zoomImg').style.display = 'none'; // Hide the Zoomify div
		document.getElementById('prodImg').style.display = 'block';	 // Show the Image div
		
		document.getElementById('zoomifyLink').style.display = 'block'; // Show the Closer Look button
		document.getElementById('productImageLink').style.display = 'none'; // Hide the Product Image button
	}	
}

function getURLParam(strParamName)
{
  var strReturn = "";
  var strHref = window.location.href;
  if (strHref.indexOf("?") > -1)
  {
	  var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
	  var aQueryString = strQueryString.split("&");
	  for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
	  {
		  if(aQueryString[iParam].indexOf(strParamName + "=") > -1 )
		  {
			  var aParam = aQueryString[iParam].split("=");
			  strReturn = aParam[1];
			  break;
		  }
	  }
  }
  return strReturn;
}

function moreByArtistSubmit(thing, cartid)
{
	document.write('<form name="frmPSearch" method="post" action="PSearchResult.asp?CartId='+cartid+'&Tp=">');
	document.write('<input type="hidden" name="selManufacturer" value="'+thing+'">');
	document.write('</form>');
	
	document.frmPSearch.submit();
}

