var swatchcard;
var NewWindow;
function closeSwatchcard(){
	if (swatchcard) swatchcard.close();
}
function ShowPopup(FileURL, ImgHeight, ImgWidth) {
var WinHeight=Math.floor(screen.height);
   if (WinHeight >= 600) {
	var WinLeft=Math.floor((screen.width-ImgWidth)/2);
	var WinTop=Math.floor((screen.height-ImgHeight)/2);
	var WinAppearence = 'scrollbars=yes,width='+(ImgWidth)+',height='+(ImgHeight)+',top='+WinTop+',left='+WinLeft;
   } else {
	ImgHeight=WinHeight-100;
	var WinLeft=Math.floor((screen.width-ImgWidth)/2);
	var WinTop=Math.floor((screen.height-ImgHeight)/2);
	var WinAppearence = 'scrollbars=yes,width='+(ImgWidth)+',height='+(ImgHeight)+',top='+WinTop+',left='+WinLeft;
   }
   NewWindow=window.open( FileURL,'',WinAppearence);
   swatchcard = NewWindow;
   NewWindow.focus();
}
function setInputValue(id, tag){
	var val;
	var srcobj = document.getElementById(id + tag);
	var trgobj = document.getElementById('input' + tag);
	if (srcobj){ val=unescape(srcobj.innerHTML); }
	if (trgobj){ trgobj.value = val; }
}
function setInputCheck(id, tag){
	var val;
	var srcobj = document.getElementById(id + tag);
	var trgobj = document.getElementById('input' + tag);
	if (srcobj){ val=unescape(srcobj.innerHTML); }
	if (trgobj){ 
			if (val == 'Y')
				trgobj.checked = 1; 
			else 	
				trgobj.checked = 0; 
	}
}
function showPanel(id, tag){
	document.getElementById(id).style.visibility='VISIBLE';
	var obj = document.getElementById('action');
	if(obj && tag) { obj.value = tag; }
}
function hidePanel(id){
	document.getElementById(id).style.visibility='HIDDEN';
}