function showPriceList(id)
{
	showModalDialog("../member/open_price_list.php?member_id="+id, "", "help: no; status: no; scroll: yes;");
	return false;
}
function showMember(id)
{
	showModalDialog("../member/open_member_detail.php?member_id="+id, "", "help: no; status: no; scroll: yes;");
	return false;
}
function showReviewForm(id)
{
	r=showModalDialog("../review/review_form.php?product_id="+id, "", "help: no; status: no; scroll: yes;");
	return r;
}
function showCalendar(id)
{
	var date = showModalDialog("../editor/popup_calendar.php", "", "help: no; status: no; scroll: no;");
	if (date)
	{
		eval(id).value=date;
	}
}
function image_win(image_loc,img)
{
  HTML = "<html><title>Zoom out image</title><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+40,document.load_image.height+40);window.moveTo(parseInt(window.screen.availWidth)/2-parseInt(document.load_image.width)/2,parseInt(window.screen.availHeight)/2-parseInt(document.load_image.height)/2)'></body></html>";
  popupImage = window.open('','_blank','scrollbars=yes,resizable,status=no');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
}


function doMark(id)
{
	st=eval('document.all.'+id);
	if(st.className=='cellcheck')
		st.className='celluncheck';
	else
		st.className='cellcheck';
}
function doOpen(file,field,show)
{
	open(file+'?return='+field+'&show='+show,'','width=350,height=350,top=0,left=0,scrollbars,status,resize');
	return false;
}
function doOpenWindow(file,width,height,top,left)
{
	if(width=="")
		width=460;
	if(height=="")
		height=460;
	if(top=="")
		top=0;
	if(left=="")
		left=0;
	open(file,'','width='+width+',height='+height+',top='+top+',left='+top+',scrollbars,status,resize');
	return false;
}

function openImage(vLink, vHeight, vWidth)
{
	var sLink = (typeof(vLink.href) == 'undefined') ? vLink : vLink.href;

	if (sLink == '')
	{
		return false;
	}

	winDef = 'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(vHeight).concat(',').concat('width=').concat(vWidth).concat(',');
	winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
	winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
	newwin = open('', '_blank', winDef);

	newwin.document.writeln('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">');
	newwin.document.writeln('<a href="" onClick="window.close(); return false;"><img src="', sLink, '" alt="', 'Dong lai', '" border=0></a>');
	newwin.document.writeln('</body>');

	if (typeof(vLink.href) != 'undefined')
	{
		return false;
	}
}

var idDIV="imgPopup";
var idDIVX="imgScreen";
function image_open(text,i)
{ 
	hideDIV(idDIV);
	w = 200;                     
	border = "10px solid #eeeeee";   
	var img2=new Image();
	img2.src=text;	
	s = (border ? 'border:' + border + '; ' : '');
	t='<div title="Click to close" onclick="hideDIV(\''+idDIV+'\')" ' + (s ? ' style="' + s + '"' : '') + '>';
	t+='<img src='+text+' style="border:1px solid #888888"></div>';	
	
	left=((parseInt(getWinX())- parseInt(img2.width))/2)+parseInt(getScrX());
	top1=((parseInt(getWinY())- parseInt(img2.height))/2)+parseInt(getScrY());
	document.getElementById(idDIV).style.left = left;
	document.getElementById(idDIV).style.top = top1;
	document.getElementById(idDIV).innerHTML= t;	
	document.getElementById(idDIV).style.visibility = 'visible';
	
	document.getElementById(idDIVX).style.left = 0;
	document.getElementById(idDIVX).style.top = 0;
	document.getElementById(idDIVX).style.height = 1000+getScrY();
	document.getElementById(idDIVX).style.width = '100%';
	document.getElementById(idDIVX).style.backgroundImage="url(../javascript/overlay.png)";	
	document.getElementById(idDIVX).style.visibility = 'visible';
	
}
function hideDIV(id)
{
   document.getElementById(id).style.height = '0px';
	document.getElementById(id).style.width = '0px';
   document.getElementById(id).style.visibility = 'hidden';	
   document.getElementById(idDIVX).style.height = '0px';
	document.getElementById(idDIVX).style.width = '0px';
   document.getElementById(idDIVX).style.visibility = 'hidden';	
}
function getScrX() {
  var offset = 0;
  if(window.pageXOffset)
    offset = window.pageXOffset;
  else if(document.documentElement && document.documentElement.scrollLeft)
    offset = document.documentElement.scrollLeft;
  else if(document.body && document.body.scrollLeft)
    offset = document.body.scrollLeft;
  return offset;
}
function getScrY() {
  var offset = 0;
  if(window.pageYOffset)
    offset = window.pageYOffset;
  else if(document.documentElement && document.documentElement.scrollTop)
    offset = document.documentElement.scrollTop;
  else if(document.body && document.body.scrollTop)
    offset = document.body.scrollTop;
  return offset;
}
function getWinX() {
  var size = 0;
  if(window.innerWidth)
    size = window.innerWidth;
  else if(document.documentElement && document.documentElement.clientWidth)
    size = document.documentElement.clientWidth;
  else if(document.body && document.body.clientWidth)
    size = document.body.clientWidth;
  else size = screen.width;
  return size;
}
function getWinY() {
  var size = 0;
  if(window.innerHeight)
    size = window.innerHeight;
  else if(document.documentElement && document.documentElement.clientHeight)
    size = document.documentElement.clientHeight;
  else if(document.body && document.body.clientHeight)
    size = document.body.clientHeight;
  else size = screen.height;
  return size;
}
document.write('<div id="'+idDIV+'" style="position:absolute; visibility:hidden;z-index:100"></div>');
document.write('<div id="'+idDIVX+'" style="position:absolute; visibility:hidden;z-index:10"></div>');
