/**
* @author Mikhail Starovojt
* @author Irina Miroshnichenko
*/
var MstarGeneral=function (data) {
};


MstarGeneral.prototype.ShowHideElement = function (NewState)
{
	var elements = document.documentElement.getElementsByTagName('select');
	for (var i=0; i<elements.length; i++) {
		elements[i].style.visibility = NewState;
	}
};

/**
* Add option to the current select in the client side
*
* @param int selectId - id of select element
* @param String txt - text of option
* @param String val - value of option
*/
MstarGeneral.prototype.AddOption = function(selectId, txt, val){
	var objOption = new Option(val, txt, false, false);
	document.getElementById(selectId).options.add(objOption);
}

/**
* Clear select
*
* @param int selectId - id of select element
*/
MstarGeneral.prototype.ClearAllOption = function(selectId){
	document.getElementById(selectId).length=0;
}

MstarGeneral.prototype.SwitchPrice = function(CurrentActive){
	if (CurrentActive=='retail') {
		//		document.getElementById('price_tab_retail').className='sel';
		//		document.getElementById('price_tab_margin').className='';
		document.getElementById('price_action').value='catalog_price_make_view';
	}
	else {
		//		document.getElementById('price_tab_retail').className='';
		//		document.getElementById('price_tab_margin').className='sel';
		document.getElementById('price_action').value='catalog_part';
	}
}

MstarGeneral.prototype.ToggleTr = function (sId)
{
	oTr=$('#invoice_detail_'+sId);

	if (oTr.css("display")=="none") {
		oTr.show();
		$('#hide_detail_'+sId).show();
		$('#show_detail_'+sId).hide();
	}
	else {
		oTr.hide();
		$('#hide_detail_'+sId).hide();
		$('#show_detail_'+sId).show();
	}
}

var general=new MstarGeneral();