
function SelectChange()
{
//alert(document.nav.section_nav.value)
if (document.layers) 
{
	if (document.navigate.select_nav.value!="none")
	{
		self.location=document.navigate.select_nav[document.navigate.select_nav.selectedIndex].value;	
	}
}
else if (document.all)
{
	
	if (document.navigate.select_nav.value!="none")
	{
		self.location=document.navigate.select_nav[document.navigate.select_nav.selectedIndex].value;
	}
}
}
function navChange()
{
//alert(document.nav.section_nav.value)
if (document.layers) 
{
	if (document.nav.section_nav.value!="none")
	{
		self.location=document.nav.section_nav[document.nav.section_nav.selectedIndex].value;	
	}
}
else if (document.all)
{
	
	if (document.nav.section_nav.value!="none")
	{
		self.location=document.nav.section_nav[document.nav.section_nav.selectedIndex].value;
	}
}
}


function popUp(name) {
		newWindow = window.open(name, 'newWindow', 'toolbar,scrollbars,height=200,width=400');
}

	function make_obj(obj){	
		var n = (document.layers) ? 1:0;
		var ie = (document.all) ? 1:0;			
    	this.css=(n) ? eval('document.'+obj):eval(obj+'.style')		
		this.show_it=show_obj;				
		this.hide_it=hide_obj;
		return this
	}
	function hide_obj(which)
	{
		var browser=navigator.appName;
		if (browser=='Microsoft Internet Explorer')
		{
			div_array[which].css.position="absolute";
			div_array[which].css.visibility="hidden";
		}
		else
		{
			document.getElementById('init_div' + which).style.visibility='hidden';
			document.getElementById('init_div' + which).style.position='absolute';
		}
	}
	function show_obj(which, div_height)
	{
		var browser=navigator.appName;
		if (browser=='Microsoft Internet Explorer')
		{
			div_array[which].css.position="relative";
			div_array[which].css.height=div_height;
			div_array[which].css.visibility="visible";
		}
		else
		{
			document.getElementById('init_div' + which).style.visibility='visible';
			document.getElementById('init_div' + which).style.height=div_height;
			document.getElementById('init_div' + which).style.position='relative';
		}
	}
	
	function init(obj_count)
	{
		var browser=navigator.appName;
		if (browser=='Microsoft Internet Explorer')
		{
			for (x=0;x<obj_count;x++)
			{
				div_array[x]=new make_obj('init_div' + x);
			}
		}
		hide_all(obj_count);
	}
	function show_all(obj_count, div_height)
	{
		var browser=navigator.appName;
		//alert(obj_count);
		for (x=0;x<obj_count;x++)
		{
			//alert(x);
			if (browser=='Microsoft Internet Explorer')
			{
				div_array[x].css.position='relative';
				div_array[x].css.height=div_height;
				div_array[x].css.visibility='visible';
			}
			else
			{
				document.getElementById('init_div' + x).style.visibility='visible';
				document.getElementById('init_div' + x).style.height=div_height;
				document.getElementById('init_div' + x).style.position='relative';
			}
		}	
	}
	function hide_all(obj_count)
	{
		var browser=navigator.appName;
		//alert(obj_count);
		for (x=0;x<=obj_count-1;x++)
		{
			//alert(x);
			if (browser=='Microsoft Internet Explorer')
			{
				div_array[x].css.position='absolute';
				div_array[x].css.visibility='hidden';
			}
			else
			{
				document.getElementById('init_div' + x).style.position='absolute';
				document.getElementById('init_div' + x).style.visibility='hidden';
			}
		}	
	}

function popUpSearchWindow(name) {
		
		newWindow = window.open(name, 'QuickSearch', 'toolbar,scrollbars,height=350,width=700');
		newWindow.focus();
}

function popUpLarge(name) {
		
		newWindow = window.open(name, 'LargeWindow', 'toolbar,scrollbars,height=600,width=800');
		newWindow.focus();
}
function popUpError(name) {
		
		EWindow = window.open(name, 'LargeWindow', 'toolbar,scrollbars,height=400,width=800');
		EWindow.focus();
}

function printpage() {
window.print();  
}
function popUp(name) {
		newRWindow = window.open(name, 'newRWindow', 'toolbar,scrollbars,height=270,width=410');
		newRWindow.focus();
}
function popUpSmall(name) {
		newRWindow = window.open(name, 'newRWindow', 'toolbar,scrollbars,height=270,width=410');
		newRWindow.focus();
}

function popUpFileUtil(name) {
		//alert(name)
		newFileWindow = window.open(name, 'newFileWindow', 'toolbar,scrollbars,height=270,width=410');
		newFileWindow.focus();
}
function popUpMedium(name) {
		newWindow = window.open(name, 'newWindow', 'scrollbars,height=580,width=800');
		newWindow.focus();
}
function popUpWide(name) {
		newWideWindow = window.open(name, 'newWideWindow', 'scrollbars,height=410,width=800');
		newWideWindow.focus();
}
function popUpLong(name) {
		newWindow = window.open(name, 'newWindow', 'scrollbars,height=330,width=550');
		newWindow.focus();
}
function popUpHuge(name) {
		HugeWindow = window.open(name, 'HugeWindow', 'scrollbars,height=550,width=750');
		HugeWindow.focus();
}
function popUpInvoice(name) {
		InvoiceWindow = window.open(name, 'InvoiceWindow', 'scrollbars,height=250,width=350');
		InvoiceWindow.focus();
}
function popUpTall(name) {
		TallWindow = window.open(name, 'TallWindow', 'scrollbars,height=500,width=500');
		TallWindow.focus();
}
function ChangeStatus_Flash(strMsg)
{
	//setTimeout("ChangeStatus(strMsg);",speed);
	FlashStatus(strMsg, 1)
}

function FlashStatus(strMsg, control)
{
	var speed = 250;		

	if (control == 1)
	{
	  window.status=strMsg;

	  control=0;
	}
	else
	{
	  window.status=" ";

	  control=1;
	}

	setTimeout("FlashStatus('" + strMsg + "','" + control + "');",speed);
}

function ChangeStatus(strMsg)
{
	window.status = strMsg;
}

function DeleteCookie(name) {
var expire = new Date ();
expire.setTime (expire.getTime() - (24 * 60 * 60 * 1000)); 
document.cookie = name + "=; expires=" + expire.toGMTString(); 
}
function help_window(name) {
		newWindow = window.open(name, 'newWindow', 'toolbar,height=400,width=600');
		newWindow.focus();
}

function showMenu(menu, submenu)
{


//alert(typeof parent.main.document.getElementById(submenu))
if (!parent.main.document.getElementById(submenu))
	// Menu has not been drawn.
	return true;
else
	{
		if (submenu.length > 0)
		{
		parent.main.document.getElementById(submenu).style.position = "absolute"
		parent.main.document.getElementById(submenu).style.visibility = "visible"
		}
		parent.nav_top.document.getElementById(menu).style.position="absolute"
		parent.nav_top.document.getElementById(menu).style.visibility = "visible"
	}
}

function hideMenu(menu, submenu)
{
if (!parent.main.document.getElementById(submenu))
	// Menu has not been drawn.
	return true;
else
	{
		parent.nav_top.document.getElementById(menu).style.visibility = "hidden"
		parent.nav_top.document.getElementById(menu).style.position="absolute"
		if (submenu.length > 0)
		{
			parent.main.document.getElementById(submenu).style.visibility = "hidden"
			parent.main.document.getElementById(submenu).style.position = "absolute"
		}
	}
}
function drawMenu(the_menu, the_width, from_left, from_top)
{

if (screen.width > 800) 
	document.write('<div id=' + the_menu + ' style=background-color:black;width:' + the_width + ';left:' + from_left + ';top:' + from_top + '>');
else 
	document.write('<div id=' + the_menu + ' style=background-color:black;width:' + the_width + ';left:' + from_left + ';top:' + from_top + '>');

document.write('<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0 bgcolor=black height=100% width=100%>');
document.write('<TR>')
//document.write('<TD align=center colspan=2><font color=white class=dash>---------------</font></TD>');
//document.write('</TR><TR>')
//if (the_menu == "odmenu")
//	{
//		document.write('<TD colspan=2 valign=top>&nbsp;</td></tr>');
//		document.write('<TD colspan=2 valign=top>');
//		document.write('<img src=/ormedx/images/item_search3.gif align=left>');
//		document.write('<a class=other_hover href=vendor/order_desk/rfps/rfp_list.asp?mscssid='+si+' target=main>Request for Purchases</a></td></TR><TR>');
//	}
//if (the_menu == "csmenu")
//	{
		document.write('<TD colspan=2 valign=top>&nbsp;</td></tr>');
		document.write('<TD colspan=2 valign=top>');
		document.write('<font color=white>-----------------------</font></td></TR><TR>');
		//document.write('<img src=/ormedx/images/item_search3.gif align=left>');
		//document.write('<a class=other_hover href=buyer/pos/index.asp?mscssid='+si+' target=main>Purchase Orders</a></td></TR><TR>');
//	}	
document.write('</a></TD></TR><tr><td colspan=2>&nbsp;</td></tr></TABLE></div>');		
}

function hide_all_p(menu, submenu)
{
	
	if (submenu.length > 0)
	{
		if (!parent.main.document.getElementById(submenu))
			return true;
		else
		{
			parent.main.document.getElementById(submenu).style.visibility = "hidden"
			parent.main.document.getElementById(submenu).style.position = "absolute"
		}
	}
	if (menu.length > 0)
	{
		if (!parent.nav_top.document.getElementById(menu))
		return true;
		else
		{
			parent.nav_top.document.getElementById(menu).style.visibility = "hidden"
			parent.nav_top.document.getElementById(menu).style.position="absolute"
		}
	}
}
function j_confirm(message_to_display)
{
	if (message_to_display.length > 0)
		if (window.confirm(message_to_display))
			return true;
		else
			return false;
}
function check_all_req_items(number_to_check)
{
	var str_check
	
	for (x=0;x<=number_to_check-1;x++)
		{
			if (document.form_req.send_all.checked==true)
				str_check = "document.form_req.ch_line_" + x + ".checked = true"		
			else
				str_check = "document.form_req.ch_line_" + x + ".checked = false"		
			
			eval(str_check)
			//alert(eval(str_check))
		}
	if (document.form_req.send_all.checked==true)
	{	
		document.form_req.button_po.disabled=false;
		// Comment out for live push if RFQs are not ready.
		if (document.form_req.button_rfq)
			document.form_req.button_rfq.disabled=false;	
	}
	else
	{	
		document.form_req.button_po.disabled=true;
		// Comment out for live push if RFQs are not ready.
		if (document.form_req.button_rfq)
			document.form_req.button_rfq.disabled=true;	
	}	
}
function check_req_item()
{
	var number_to_check = document.form_req.lc.value
	var str_check
	var lines_checked = 0
	for (x=0;x<=number_to_check-1;x++)
	{
		str_check = "document.form_req.ch_line_" + x + ".checked == true"
		if (eval(str_check))
			lines_checked+=1;
	}
	if (lines_checked==0)
	{
		document.form_req.button_po.disabled=true;
		// Comment out for live push if RFQs are not ready.
		document.form_req.button_rfq.disabled=true;	
	}
	else
	{
		document.form_req.button_po.disabled=false;
		// Comment out for live push if RFQs are not ready.
		document.form_req.button_rfq.disabled=false;	
	}			
}
function showh(layerName)
        {
            if (document.getElementById) // Netscape 6 and IE 5+
            {
				
                var targetElement = document.getElementById(layerName);
                targetElement.style.visibility = 'visible';
            }
        }
        function hideLayer(layerName)
        {
            if (document.getElementById) 
            {
                var targetElement = document.getElementById(layerName);
                targetElement.style.visibility = 'hidden';
            }
        }
function showHideSection(id,vis) {

	for (x=0;x<=number_of_sections-1;x++)
	{
		section_name = "Section" + sections[x];
		if (section_name!=id)
		{
			document.getElementById(section_name).style.visibility='hidden';	
			link_name = section_name + "_link";
			document.getElementById(link_name).style.font='12px Arial';
			document.getElementById(link_name).style.color='blue';
		}
	}
	document.getElementById(id).style.visibility=vis;
	document.getElementById('add').style.visibility=vis;
	link_name = id + "_link";
	document.getElementById(link_name).style.font='20px Arial';
	document.getElementById(link_name).style.color='black';
}
function showHideSectionC(id,vis) {
	
	for (x=0;x<=number_of_sections-1;x++)
	{
		section_name = "Section" + sections[x];
		if (section_name!=id)
		{
			//alert(section_name);
			document.getElementById(section_name).style.visibility='hidden';	
			//alert(section_name);
			link_name = section_name + "_link";
			//alert(section_name);
			document.getElementById(link_name).style.font='12px Arial';
			//alert(section_name);
			document.getElementById(link_name).style.color='blue';
		}
	}
	document.getElementById(id).style.visibility=vis;
	link_name = id + "_link";
	document.getElementById(link_name).style.font='20px Arial';
	document.getElementById(link_name).style.color='black';
}