var catalog_name = 'Singlesource4Q08';	        // Replace with the catalog name
var catalog_name2 = 'Healthcare4Q08';
var catalog_name3 = 'cbs4Q08';
var catalog_name4 = 'gogreen';
var client_name = 'spr';		    // Replace with the client name
var distid = 'SPAA1074IFF';	 	    // Replace with distributor id
//var versioningid = '3';			//Replace with cover number catalogs
var passback = '';	//Replace with the variables you would like to get in the product page (example: var passback = 'param1=value1&param2=value2')		

if (location.search.match(/(rfx_catalogname|catalog_name)=([^&=]*)(&|$)?/)) catalog_name = RegExp.$2;
if (location.search.match(/(rfx_catalogname|catalog_name2)=([^&=]*)(&|$)?/)) catalog_name2 = RegExp.$2;
if (location.search.match(/(rfx_catalogname|catalog_name3)=([^&=]*)(&|$)?/)) catalog_name3 = RegExp.$2;
if (location.search.match(/(rfx_catalogname|catalog_name4)=([^&=]*)(&|$)?/)) catalog_name4 = RegExp.$2;
if (location.search.match(/rfx_versioningid=([^&=]*)(&|$)?/)) versioningid=RegExp.$1;

function rfxopenWin(who,sp_version){
	if (location.href.indexOf('testny') > 0 || location.href.indexOf('rfx_staging') > 0)
	{ var url = 'http://testny.richfx.com/catalog_' + client_name + '/' + who + '/index.aspx'												
	}
	else {
		var CDN = (location.search.match(/rfx_dontcache=true(&|$)?/) ? "" : ".edgesuite.net");
		// we are on live
		var url = 'http://' + client_name + '.richfx.com'+CDN+'/catalog_' + client_name + '/' +  who + '/index.aspx';
	}
	url += "?rfx_passback=" + escape(passback) + "&rfx_distid=" + distid;
	if (sp_version.length>0) url+="&rfx_versioningid="+sp_version;
	catalog = window.open(url,'catalog');
	catalog.focus();
}

function openBook(www){
var url=www;
var bookWin = open("","APBook",  
"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,width=1150,height=700");
bookWin.moveTo(0,0);
bookWin.resizeTo(screen.availWidth,screen.availHeight);
bookWin.focus();
bookWin.location=url;
return false;
}
