
function swapTrBgColor(changeMe, color)
{
	theCells = changeMe.getElementsByTagName('td');

	for(i=0; i<theCells.length; i++)
	{
		theCells[i].style.backgroundColor = color;
	}
}


function toggleVisibility(element)
{
	if(document.getElementById(element).style.visibility == "hidden")
	{
		document.getElementById(element).style.visibility = "visible"
	}
	else
	{
		document.getElementById(element).style.visibility = "hidden"
	}
}


function toggleDisplay(id)
{
	if(document.getElementById(id).style.display=="block")
	{
		document.getElementById(id).style.display="inline";
	}
	else
	{
		document.getElementById(id).style.display="block";
	}

}


function toggleBlock(nr)
{
	if (document.layers)
	{
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		document.layers[nr].display = current;
	}
	else if (document.all)
	{
		current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
		document.all[nr].style.display = current;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		document.getElementById(nr).style.display = vista;
	}
}



function block(nr)
{
	if (document.layers)
	{
		document.layers[nr].display = 'none';
	}
	else if (document.all)
	{
		document.all[nr].style.display = 'none';
	}
	else if (document.getElementById)
	{
		document.getElementById(nr).style.display = 'none';
	}
}



function unBlock(nr)
{
	if (document.layers)
	{
		document.layers[nr].display = 'block';
	}
	else if (document.all)
	{
		document.all[nr].style.display = 'block';
	}
	else if (document.getElementById)
	{
		document.getElementById(nr).style.display = 'block';
	}
}



function toggleProductInfoo(show, hide)
{
	showProductInfo(show);
	hideProductInfo(hide);
}


function toggleProductInfo(show, hide)
{
	if (document.layers)
	{
		if(document.layers[nr].display == 'none')
		{
			showProductInfo(nr);
		}
		else
		{
			hideProductInfo(nr);
		}
	}
	else if (document.all)
	{
		if(document.all[nr].style.display == 'none')
		{
			showProductInfo(nr);
		}
		else
		{
			hideProductInfo(nr);
		}

	}
	else if (document.getElementById)
	{
		if(document.getElementById(nr).style.display == 'none')
		{
			showProductInfo(nr);
		}
		else
		{
			hideProductInfo(nr);
		}
	}
}



function hideProductInfo(id)
{
	if (document.layers)
	{
		document.layers[id].display = 'none';
	}
	else if (document.all)
	{
		document.all[id].style.display = 'none';
	}
	else if (document.getElementById)
	{
		document.getElementById(id).style.display = 'none';
	}
}




function showProductInfo(id)
{
	if (document.layers)
	{
		document.layers[id].display = 'block';
	}
	else if (document.all)
	{
		document.all[id].style.display = 'block';
	}
	else if (document.getElementById)
	{
		document.getElementById(id).style.display = 'block';
	}
}


function openScreenWindow(product_id, width, height)
{
	width = parseInt(width) + parseInt(129);
	height = parseInt(height) + parseInt(100);

	w = window.open('screenImageWindow.php?id='+product_id,'', 'width='+width+', height='+height+', status=no, scrollbars=yes, toolbar=0, left=250, top=135, resizable=no');
}


function openAccessorieWindow(product_id, width, height)
{
	width = parseInt(width) + parseInt(129);
	height = parseInt(height) + parseInt(100);

	w = window.open('accessorieImageWindow.php?id='+product_id,'', 'width='+width+', height='+height+', status=no, scrollbars=yes, toolbar=0, left=250, top=135, resizable=no');
}


function openPrintWindow()
{
	w = window.open('printableReceiptWindow.php','', 'width=450, height=600, status=no, scrollbars=yes, toolbar=1, left=250, top=135, resizable=no');
}


function openPrintWindowInvoiceConf()
{
	w = window.open('printableInvoiceConfWindow.php','', 'width=450, height=600, status=no, scrollbars=yes, toolbar=1, left=250, top=135, resizable=no');
}



function openPrintWindowIFA()
{
	w = window.open('printableIFAWindow.php','', 'width=450, height=600, status=no, scrollbars=yes, toolbar=1, left=250, top=135, resizable=no');
}



function openPrintWindowAdmin()
{
	w = window.open('printableReceiptWindowAdmin.php','', 'width=450, height=600, status=no, scrollbars=yes, toolbar=1, left=250, top=135, resizable=no');
}


function openPriceListWindow()
{
	w = window.open('priceListWindow.php','', 'width=705, height=600, status=no, scrollbars=yes, toolbar=1, menubar=yes, left=75, top=135, resizable=yes');
}



function openPriceEditWindow(product_id)
{
	w = window.open('editPriceWindow.php?p_id='+product_id,'', 'width=300, height=300, status=no, scrollbars=no, toolbar=0, menubar=no, left=75, top=200, resizable=no');
}


function openWindow(href)
{
	w = window.open(href,'', 'width=625, height=550, status=no, scrollbars=yes, toolbar=1, left=150, top=100, resizable=yes');
}


function openPdfWindow(href)
{
	w = window.open('../../uploaded_files/pdf/'+href,'', 'width=625, height=575, status=no, scrollbars=yes, toolbar=1, left=150, top=100, resizable=yes');
}


function openProductPrintWindow(href)
{
	w = window.open(href, '', 'width=465, height=600, status=no, scrollbars=yes, toolbar=0, left=150, top=100, resizable=yes');	
}



function toggleExplanation(element)
{
	if(document.getElementById(element).style.visibility == "hidden")
	{
		document.getElementById(element).style.visibility = "visible"
	}
	else
	{
		document.getElementById(element).style.visibility = "hidden"
	}
}



function hide(element)
{
	document.getElementById(element).style.visibility = "hidden"
}







