var publisPath = '';

function publisSetPath(_path) {
	publisPath = _path;
}

function publisSwapImage(_targetId, _src) {
	var obj = document.getElementById(_targetId);
	if( obj != undefined ) {
		var aliasBase;
		if( location.href.match(/view\.php/) ) {
			aliasBase = '';
		}  else {
			aliasBase = publisPath;
		}
		obj.src = aliasBase + _src;
	}
}

function publisLoadFlash(_regionName, _src, _width, _height, _base) {
	var aliasBase;
	if( location.href.match(/view\.php/) ) {
		aliasBase = '';
	}  else {
		aliasBase = publisPath;
	}
	var obj = document.getElementById(_regionName);
	if( obj != undefined ) {
		
		var base = '';
		var embedBase = '';
		if(_base == undefined) {
			base = '';
			embedBase = '';
		} else {
			base = '<param name="base" value="'+aliasBase+_base+'" />';
			embedBase = 'base="'+aliasBase+_base+'"';
		}
		
		var src = aliasBase+_src;
		obj.innerHTML = '<OBJECT id=flashDispatcher codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height="'+_height+'" width="'+_width+'" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME="Movie" VALUE="'+src+'"><PARAM NAME="Src" VALUE="'+src+'"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="Menu" VALUE="0">'+base+'<embed '+embedBase+' src="'+src+'" quality="high" bgcolor="#ffffff" name="flashDispatcher" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="" height="'+_height+'" width="'+_width+'"></OBJECT>';
	}
}

function publisOpenWindow(_url, _title, _param) {
	var aliasBase;
	if( location.href.match(/view\.php/) ) {
		aliasBase = '';
	}  else {
		aliasBase = publisPath;
	}
	var url = aliasBase + _url;
	var win = window.open(url, _title, _param);
 	win.focus();
}