// JavaScript Document
// E-Way JS Functions

var vpath="/ce/eway/";
var secureURL="https://www.eway.com/ce/eway/";
var imgDir = "/images/";
function check_and_save_header() {
  if (parent.eway_header_flag) { 
     parent.main.f_save_order("GLOBALNAV");
  }
}
function f_help_window () {
  window2=open("/corp/ewaytutorial/tutor_start.html","helpwindow","height=500,width=750,scrollbars=yes,resizable=yes,toolbar=yes,location=no,menubar=no")
}
function appbull(title){
  check_and_save_header();
  if (title == "" || title == null) { 
     parent.main.location.href = vpath + "bulletin.b_view";
  } else { 
     parent.main.location.href = vpath + "bulletin.b_view?title="+escape(title);
  }
}
function order() {
check_and_save_header();
parent.main.location.href = vpath + "order_utility.p_view_current_order";
}
function search() {
check_and_save_header();
parent.main.location.href  = vpath + "ord_search.p_orders_search_results"
}
function order_approvals() {
check_and_save_header();
parent.main.location.href = vpath + "approvals.p_approvals";
}
function storefront() {
check_and_save_header();
parent.main.location.href = vpath + "product_catalog_manager.forward_to_storefront?i_storefront_type=IAT";
}
function punchout() {
  check_and_save_header();
  parent.main.location.href = vpath + "four51.setup_request";
}
function profile() {
check_and_save_header();
parent.main.location.href = vpath + "user_profile.p_personal_info";
}
function express() {
check_and_save_header();
parent.location.href = vpath + "shopping_list.p_sl_lists_search_results"
}
function support() {
check_and_save_header();
parent.main.location.href = vpath + "contact.p_mysupport"
}
function catalog() {
check_and_save_header();
parent.main.location.href = vpath + "eway_catalog.p_super_categories";
}
function logoff_standard() {
if (parent.corder.document.form_iway_current_order.order_count.value > 0) {
	if (parent.corder.document.form_iway_current_order.pl_order_modified_flag.value == "Y") {
				if (confirm("Your order has not been saved.  Click OK to save your order or Cancel to continue without saving.")) {
							parent.invisible.location.href  = vpath + "order_utility.p_copy_iway_order?update_current_ordr_flag=N&leaving_flag=Y&pl_save_alert=Y"
				} else { 
							parent.invisible.location.href  = vpath + "p_exit_eway"
				}
	} else {
				parent.invisible.location.href  = vpath + "p_exit_eway"
	}
} else { 
	parent.invisible.location.href  = vpath + "p_exit_eway"
}
}
function logoff_non_standard() {
parent.window.location = document.nav.exit_url.value;
}
function itemDetail(mfgitemno,inmerch) {
   // call the cwa's version of the item detail page:
   if("1" == inmerch)
   {
       updsession("/productCatalogWebApp/productdetail.do?rcompid=N&detailId=" + mfgitemno + "&in_merch=1");
   }
   else
   {
       updsession("/productCatalogWebApp/productdetail.do?rcompid=N&detailId=" + mfgitemno);
   }
}
