function getBrowserInfo() {
var t,v = undefined;
if (window.opera) t = 'Opera';
 else if (document.all) {
 t = 'IE';
 var nv = navigator.appVersion;
 var s = nv.indexOf('MSIE')+5;
 v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}


function iePNGFix(dImg)
{
	dImg.runtimeStyle.behavior='none';

	var src = dImg.src ;
	if(src.substr( src.length-4 , 4).toLowerCase() != '.png'){return;}
	if(!dImg.complete){setTimeout( function(){ iePNGFix(dImg);} ,100 );}
	else
	{
		var dParentNode = dImg.parentNode;
		var oParentNodeStyle = dParentNode.runtimeStyle ;
		var oImgStyle =  dImg.currentStyle;
		var sDisplay = dParentNode.currentStyle.display.toLowerCase();
		dParentNode.title = ( dImg.title || dImg.alt );
		oParentNodeStyle.width = dImg.width + 'px';
		oParentNodeStyle.height = dImg.height + 'px';
		oParentNodeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + dImg.src + "',sizingMethod='scale')";
		oParentNodeStyle.border = [ oImgStyle.borderStyle , oImgStyle.borderWidth , oImgStyle.borderColor ].join(' ');
		if(! dParentNode.currentStyle.hasLayout){oParentNodeStyle.display = 'inline-block' ;};
	};
};


function more(obj) {
	var dom = obj;
	while (dom.tagName != 'TR' || dom.tagName == 'BODY') {
		dom = dom.parentNode;
	}
	var c = dom.cloneNode(true);
	c.lastChild.innerHTML = '<input type="button" value="[X]"  onclick="del(this);" />';

	var newObj = dom.parentNode.insertBefore(c, dom.nextSibling);
	return;
}
function del(obj) {
	var dom = obj;
	while (dom.tagName != 'TR' || dom.tagName == 'BODY') {
		dom = dom.parentNode;
	}
	dom.parentNode.removeChild(dom);
	return;
}

function __more(){
var b = getBrowserInfo();
var isIE = b.type == "IE";
//document.getElementById('num').value++;
var i = ++document.getElementById('num').value;

var item = isIE ? document.getElementById('production').getElementsByTagName("tr")[1]:document.getElementById('production').lastChild.getElementsByTagName("tr")[1];
//var item = document.getElementById('production').lastChild.getElementsByTagName("tr")[1];
var new_item = item.cloneNode(false);
var itemcontent = item.innerHTML;
itemcontent = itemcontent.replace(/product1/gi,"product"+i);
itemcontent = itemcontent.replace(/amount1/gi,"amount"+i);

	isIE ? document.getElementById('production').appendChild(new_item): document.getElementById('production').lastChild.appendChild(new_item);
	//document.getElementById('production').lastChild.appendChild(new_item);
	//document.write("-->"+document.getElementById('production').lastChild.innerHTML);
	isIE ? document.getElementById('production').lastChild.innerHTML = itemcontent : document.getElementById('production').lastChild.lastChild.innerHTML = itemcontent;//:new_item.innerHTML = itemcontent;

	new_item.lastChild.innerHTML = '<input type="button" value="[X]"  onClick="less('+i+');"/>';
	new_item.id = "item"+i;
	}

function less(n){
var i = --document.getElementById('num').value;
var lastitem = document.getElementById('item'+n);
document.getElementById('production').lastChild.removeChild(lastitem);
}
	function Check_form(){
	return true;
	}



var box = function(h,n) {
	var b = document.getElementById('box' + n);
	if ('' == b.style.display || 'none' == b.style.display) {
		b.style.display = 'block';
		h.style.backgroundImage = "url('/images/d/minus.gif')";
	} else {
		b.style.display = 'none';
		h.style.backgroundImage = "url('/images/d/plus.gif')";
	}
	return;
}
var ulcat = function(n) {
	var o = document.getElementById('cat'+n);
	if ('' == o.style.display || 'none' == o.style.display) {
		o.style.display = 'block';
	} else {
		o.style.display = 'none';
	}
}