if(typeof(eCatalogGb) == 'undefined') {
	
	var eCatalogGb = true;

	function eCatalog(root,host,site,mode,category,page,pagenum,search) {
		
		if(mode == "1" && screen.width < 1024) mode = "2";
		if(!category) category=0;
		if(!page) page=0;
		if(!pagenum) pagenum=0;
		if(!search) search = '';
		
		opt = "";
		if(mode == "1") {		// 1024x768
			
			w = 1020; h = 716; t = 0; l = 0;
			if(screen.width > 1024) {
				l = (screen.availWidth-w)/2;
				t = (screen.availHeight-h)/2;
				if(t < 50) t = 0;
				if(l < 50) l = 0;
			}
			if( navigator.userAgent.indexOf("; SV1") > -1 && screen.width == 1024 && screen.height == 768 ) opt = ",fullscreen=yes";
			
		} else if(mode == "2") {	// full
			
			w = screen.availWidth; 
			h = screen.availHeight; 
			t = 0; l = 0;
			if( navigator.userAgent.indexOf("; SV1") > -1 ) opt = ",fullscreen=yes";
		
		} else {	// before
			
			w = 800;
			h = 800;
			l = -5000;
			t = 0;
		}
		window.open(root+'/src/viewer/main.php?host='+host+'&site='+site+'&category='+category+'&page='+page+'&pagenum='+pagenum+'&ref='+Urlencode(document.location.toString())+'&search='+Urlencode(search),'','top='+t+',left='+l+',width='+w+',height='+h+',titlebar=yes,status=yes'+opt);
	}
	
	function Urlencode(str) {
	
		str = str.replace(/ /g,'%20');
		str = str.replace(/\?/g,'%3F');
		str = str.replace(/"/g,'%22');
		str = str.replace(/&/g,'%26');
		str = str.replace(/=/g,'%3D');	
		return str;	
	}
}