function checkIDs(status)
{
	for(var i=0;i<document.frm.elements.length;i++)
	{  
		var r = document.frm.elements[i];
		if (r.name == 'chkIDs') 
		{
			r.checked = status;
		}
	}
}
function remove()
{
	if(getCheckedNum() == 0)
	{
		alert("No items selected.");
		return;
	}
	
	if(confirm("Are you sure you want to remove all selected items?"))
	{
		document.frm.action="http://tradecoast.com/my/basket/remove.aspx";
		document.frm.submit();
	}
}
function inquireNow()
{
	if(getCheckedNum() == 0 && parseInt(document.frm.itemCount.value) == 0)
	{
		alert("No items selected.");
		return;
	}
	
	if(parseInt(getCheckedNum()) + parseInt(document.frm.itemCount.value) > 10)
	{
		alert("Your Inquiry Basket is full. It can store a maximum of 10 inquiries.");
		return;
	}

	document.frm.action="http://tradecoast.com/my/basket/default.aspx?cmd=inquire";
	document.frm.submit();
}
function sendNow()
{
	if(getCheckedNum() == 0)
	{
		alert("No items selected.");
		return;
	}
	if(location.href.indexOf(".en.tradecoast")!=-1)
	{
		document.frm.target="_blank";
	}
	document.frm.action="http://tradecoast.com/my/mail/send.aspx";
	document.frm.submit();
}
function addToBasket()
{
	if(getCheckedNum() == 0)
	{
		alert("No items selected.");
		return;
	}

	if(parseInt(getCheckedNum()) + parseInt(document.frm.itemCount.value) > 10)
	{
		alert("Your Inquiry Basket is full. It can store a maximum of 10 inquiries.");
		return;
	}

	document.frm.action="http://tradecoast.com/my/basket/default.aspx";
	document.frm.submit();

}
function getCheckedNum()
{
    var num = 0;                
    for(var i=0;i<document.frm.elements.length;i++)
    {  
        var e = document.frm.elements[i];
        if (e.name == 'chkIDs')
		{
            if(e.checked)
                num++;
        }
    }
    return num;
}
function view(strCompanyID, strPhotoID)
{
	window.open("http://www.tradecoast.com/products/photo_viewer.aspx?c=" + strCompanyID + "&p=" + strPhotoID + ".jpg" , "viewer", "width=500, height=500, location=no, menubar=no, status=yes, toolbar=no, scrollbars=yes, resizable=yes");
}