/*--------------------- START: Direct Document to URL  -----------------------------------------------*/
function goToURL(url){
		document.location.href=url;
}
/*--------------------- END: Direct Document to URL  -------------------------------------------------*/
/*--------------------- START: Popup Window Validation   ---------------------------------------------*/
function openPopup(x,y)
{
	var features = "scrollbars=1,status=1,toolbar=0,top=0,left=0,resizable=0,menubar=0,width=500,height=400";
	window.open(x,y,features);
}
/*--------------------- END: Popup Window Validation   -----------------------------------------------*/
/*--------------------- START: Window Close Validation   ---------------------------------------------*/
function winClose(){
  self.close();
}
/*--------------------- END: Window Close Validation   -----------------------------------------------*/
/*--------------------- START: Radio Button Validation   ---------------------------------------------*/
function checkCondition()
{	
	for (var i=0; i<document.frm.radpayment.length; i++) 
	{
		if (document.frm.radpayment[i].checked) 
		{
		var Obj = document.frm.radpayment[i];		
		goToURL(Obj.value);
		}		
	}
}
/*--------------------- END: Radio Button Validation   ---------------------------------------------*/
/*--------------------- START: Funtion Hide and Show   ---------------------------------------------*/
function showhide(selObj){
	var selVal = selObj.options[selObj.selectedIndex].value;
	
	if(selVal == 'P')
	{
		document.getElementById("PO").style.display="";
	}
	else 
	{
		document.getElementById("PO").style.display="none";
	}
}
/*--------------------- END: Funtion Hide and Show   ---------------------------------------------------*/
/*--------------------- START: Match Height Function ---------------------------------------------------*/

function matchHeight(){
	setHeight('Container');	
}
function setHeight(arg){
	var divs,contDivs,subContDivsLeft,subContDivsRight,maxHeight,subMaxHeight,divHeight,d;
	
	// get all <div> elements in the document
	divs=document.getElementsByTagName('div');
	contDivs=[];
	
	// initialize maximum height value
	maxHeight=0;
	
	// iterate over all <div> elements in the document
	for(var i=0;i<divs.length;i++)
	{
		// make collection with <div> elements with class attribute 'container'
		//if(/\bcontainer\b/.test(divs[i].className))
		if(eval("/\\b"+arg+"\\b/.test(divs[i].className)"))
		{
			d=divs[i];
			contDivs[contDivs.length]=d;
			
			// determine height for <div> element
			if(d.offsetHeight)
			{
				divHeight=d.offsetHeight;
			}
			else if(d.style.pixelHeight)
			{
				divHeight=d.style.pixelHeight; 
			}
			
			maxHeight=Math.max(maxHeight,divHeight);
		}
	}
	// assign maximum height value to all of container <div> elements
	for(var i=0;i<contDivs.length;i++){			
		contDivs[i].style.height= maxHeight + "px";
	}
}
/* --------------------- END: Match Height Function ---------------------------------------------------*/
var status=0
function showHideTab(status){
	var quick = document.getElementById("quickorder");
	var customer = document.getElementById("customerpart");
		if(status==0){
		customer.style.display="none";	
		quick.style.display="";
		status.style.id="active";	
	} 
		if(status==1){
		customer.style.display="";	
		quick.style.display="none";
		status.style.id="active";
	}
}