﻿var hdwin=0;
function close_popup()
{
	if (hdwin)	hdwin.close();
}

function popup(url,param)
{
var sparam;
	if (param=="")
		sparam="toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=500,top=0,left=200";
	else
		sparam=param;
	close_popup();
	hdwin=open(url,"",sparam);	  
	if (hdwin) hdwin.focus();  

}

function confirm_delete(url, msg)
{
	if (confirm(msg)==false)
		; //do nothing
	else
	{
		document.location.href=url;
	}
}

function confirm_delete2(form, msg)
{
    if (confirm(msg)==false)
        ; //do nothing
    else
    {
        form.hdnDelete.value='delete';
        form.submit();
    }
}

function isEmpty(str)
{
	var spcnt = 0;
	for (count=0;count<str.length;count++) 
	{
  		tmp = str.substring(count,count+1);
		if (tmp==" ")
			spcnt = spcnt+1;
	}
	if (spcnt==str.length)
		return (1);  // true
	else
		return (0);
}

function Show_Description(ProductID)
{
	popup('<%= sRelativeVirtualRoot %>description.asp?nProductID=' + ProductID,
	      'toolbar=0,location=0,directories=0,status=0,menuBars=0,scrollBars=1,resizable=1,width=500,height=350');
}

function check_selection (form, element, msg)
{
	if (element.value=='')
		alert (msg);
	else
		form.submit();
}
