var catalog_name = 'fall_2007';	//Replace with the catalog name
var client_name = 'dog';			//Replace with the client name
var versioningid = '';					//Replace with versioningid on versioning catalogs
var passback = '';						//Replace with the variables you would like to get in the product page (example: var passback = 'param1=value1&param2=value2')
var integrationType = 'left';

if (location.search.match(/(rfx_catalogname|catalog_name)=([^&=]*)(&|$)?/)) catalog_name = RegExp.$2;
if (location.search.match(/rfx_versioningid=([^&=]*)(&|$)?/)) versioningid=RegExp.$1;

function rfxopenWin(){
	if (location.href.indexOf('rfx_staging') > 0)
	{
		// We are on the staging environment	
		var url= "http://my.richfx.com/isis/preview/etc/viewers/catalog/base/index.aspx?RFX_CatalogSettingsBase=http://my.richfx.com/isis/preview/" +  client_name + "/isis_catalogs/settings/integrations/" + integrationType + "/" + "&RFX_Base=http://my.richfx.com/isis/preview/" +  client_name + "/isis_catalogs/" + catalog_name + "/project/Output/&rfx_staging=1&rfx_dontcache=true&RFX_CatalogViewerBase=http://my.richfx.com/isis/preview/etc/viewers/catalog/base/&RFX_CatalogMediaBase=http://my.richfx.com/isis/preview/" + client_name + "/isis_catalogs/" + catalog_name + "/&RFX_Catalog=../../isis_catalogs/" + catalog_name + "/project/Output&RFX_Client=" + client_name +"&RFX_CatalogSettingsPath=../../../settings/"
		url += "&rfx_passback=" + escape(passback);
	}
	else {
		var CDN = (location.search.match(/rfx_dontcache=true(&|$)?/) ? "" : ".edgesuite.net");
		// we are on live
		var url = 'http://' + client_name + '.richfx.com'+CDN+'/catalog/media/' +  catalog_name;	
		url += "?rfx_passback=" + escape(passback);
	}
	 
	if (versioningid.length>0) url+="&rfx_versioningid="+versioningid;

	catalog = window.open(url,'catalog');
	catalog.focus();
}