/*** start basket ************************/

// this contains the data of the current basket
var belenusBasket; 
var belenusBasketUserDatas; 

// this var saves the url to which the basket will be send, it will be overridden by the HOOK_URL, if it was given
// if it was an empty string, after all, the order button won't be displayed (the same like with the sendBasketByEmail)
var sendBasketTo = ""; 

//-- deprecated -- var standardEmailAddress4SendingBasketByEmail = "d.kuerstner@belenus.com"; // if the HOOK_URL dosn't contain the substring "mailto:" this address will be used 4 sending the email
var sendBasketByEmail = ""; // if this flag is an empty string, the email button won't be displayed

var whereIsTheForm=null; // don't change...

//this flag enables or disables, that you can put things into the basket
var shoppingEnabled = true;
//enable cart menus in applet?
var cartEnabled = true;

var basketFields = new Array("partno","quantity","me","description","PartsURI","cartinfo"); // define here all fields which you need in the basket
var visibleBasketFields = new Array("quantity","me","partno","description","cartinfo"); // define here which fields should be visible for the user

var basketAddressFields = new Array("d_firm","d_contact_person","d_street","d_zipcode","d_city","d_phone","d_fax","d_email","d_kd-nr","d_dealer","d_order-nr","note");

var basketServerSendAwayFields = new Array("partno","quantity","me","cartinfo");// define here which fields should be send to the server, at ordering the basket
var basketEmailSendAwayFields  = new Array("partno","quantity","me","cartinfo");// define here which fields should be shown in the email body, at ordering the basket 

// the follow vars... have in the basket a special meaning...
// they are flags... if the field is not in the visibleBasketFields.. some other fields are also not shown in the basket View....
// they need to have the names of the fields, which are used in visibleBasketFields.... from this resultant that these names are the same like in the basketFields...
// .....
var QUANTITY_PROPERTIES = new Array("quantity"); // !! important... here is the name of the quantity field defined... used by the confirmPopup & the basket for counting up...
var PRICE_PROPERTIES = new Array("price", false); //PRICE_PROPERTIES[0] = fieldName; PRICE_PROPERTIES[1] = visibile|invisible
var DESCRIPTION_PROPERTIES = new Array("description");
var PARTNO_PROPERTIES = new Array("partno");
var OCI_MASTERNUM = new Array("sap"); // this will later concat with the subNo from the querystring, by calling iparts with oci

// (1st param) sort basket for this field, this field must be defined at the basketFields...
// (2nd param) for the field in which should be sort, has a string value use "string" else if it is a num value use "int"!
var BASKET_SORT_FIELD = new Array(DESCRIPTION_PROPERTIES[0],"string");

var basketTax = "16"; // in % use . eg "17.5"
// var JUMP_TO_CATALOG
// (1st param) in which field the partsURI is saved
// (2nd param) if it's en|disabled, to jump out of the basket to the SPL...
// (3rd param) which field should have the link... can be also more fields than just one
var JUMP_TO_CATALOG = new Array("PartsURI",true, new Array("partno", DESCRIPTION_PROPERTIES[0])); 

// entries to support "composite keys" for identification of items in the basket
// all fields in this variable MUST ALSO BE IN "basketFields" and SHOULD be in "visibleBasketFields"
var basketItemIDFields = new Array("partno","description"); 
                       
var belenusBasketConfirmPopupWindow = true; // on adding an item to the basket... should popup a confirm window....

// this flag enables or disables in the basket, that the user has the ability, to put in some userinformations
// & also that in the printviews & at the order page no userinformations will be shown
var basketExtraInfo = true;

// the first array entry defines how the field will be named in the formular, which provides the basket data
// the second array entry includes an other array, in which the single entries for the select box, are be defined. 
// they are mapped with the corresponding entry in the lang.js (ld['requestTypes'+requestTypes[1][index]]).
// if the length of the array, with the select box entries is 0, it doesn't will be displayed
var requestTypes = new Array("requestTypes",new Array());

// the first array entry defines how the field will be named in the formular, which provides the basket data
// the second array entry includes an other array, in which the single entries for the select box, are be defined. 
// they are mapped with the corresponding entry in the lang.js (ld['despatchTypes'+despatchTypes[1][index]]).
// if the length of the array, with the select box entries is 0, it doesn't will be displayed
var despatchTypes = new Array("despatchTypes",new Array());

// enable or disable multiselection  for basket function
// used in applet.html writes by javascript an extra flag in the  applet  tag (<param name="multiselect" value="true">
// used in basket.js at function addItem()
var multiselection = false;

// true -> at startup, the basket will use the saved information out of the cookie, and fullfill itself (*)
// false -> at startup, the basket don't use the cookie information, which save the last basket content.
// *It only works if cookies are activated
var saveCartOnExit = true;

// enable or disable if it's possible to use the server supported basket, 
// (different framesets)
// but if you use a static version, it never will be shown
var serverSupportedBasket = false; 

// if the user is deleting all itmes.. a confirm window will shown
var delAllConfirmDialog = true;

// if the user is deleting one single item.. a confirm window will shown
var delConfirmDialog = true;

/*** end basket *************************/


/*** start search ***********************/

var SEARCH_TREEPATH = "treepath";
var SEARCH_DESCRIPTION = "description";
var SEARCH_PARTNO = "partno";
var SEARCH_TREE_LABEL = "label"; // treesearch...

// is a Server Supported Search possible, or does the applet handle all?
// used in suche.html in the function doSearch()
var serverSupportedSearch = false;//true;

// for Server Supported Search we need a SearchProcess (the displaying JSP-page)
// used in suche.html in the function makeQS().....
var searchProcess = 'result';

// in which searchfields a search (static search) is possible (also edit the caption in the language dependent file like lang/de_de/lang.js)
var static_searchFields = new Array(
  "tree:",
  "description",
  "partno");
  
// the same like above, but just for the dynamic(extended) search  
var dynamic_searchFields = new Array(
	"field:bel_folder.objectname",
	"field:p_spl.td_partno",
	"field:p_spl.td_description",
	"field:bel_folder.objectname");
  
// also used in the dynamic search, but for the simple search
var dynamic_simple_searchString = "field:bel_folder.objectname,p_spl.td_description,p_spl.td_partno";  

var SEARCH_DESCRIPTION_DYN = "td_description";
var SEARCH_PARTNO_DYN = "td_partno";

// used at startup of interparts... for running a search in the background.. for selecting a spare parts
var dynamic_immediatejump_searchString = "field:p_spl.td_partno,p_spl.td_partnona";  

// disable or enable, that the search input field will be shown in the html_navbar
// so that the user have the ability to start the search directly out of the html_navbar
var fastSearchStart = false;    

/*** end search *************************/


/*** start toolbar **********************/

var shownBtns = new Array("print", "zoomin", "zoomout", "fittowin", "fittowidth", "lens", "freescale", "previmg", "mainimg", "nextimg", "imagelist");
var customBtns = new Array();
    customBtns['fittowidth'] = "belenusHome.DetailFrame.fitToWidth()";
    customBtns['print'] = "belenusHome.DetailFrame.printDrawing()";
    
/*** end toolbar ************************/


/*** start navigation dropDownBox *********/
// if you like to change the dropdownBox... 
// have a look at the definition in the navigation.js
/*** end navigation dropDownBox **********/


// use this flag to activate cookies
// used in cookie.js 
var cookieActivate = true;

// tree path of data currently loaded into interparts
// used in part.js by the follow functions:
// jumpXLevelUp(x)
// belFolderSelected()
// belDeviceSelected()
// belDocumentSelected()
//
// & always used in ip_history.js
var currentTreePath = "/";

// for which column the spare parts list should sorted, at the initial time
var initialSortColumn = "posno";

// enable or disable that interparts will be recall the last position in the tree
// used in navbar_xx_xx.html
// writes by javascript an extra flag in the applet tag (<param name="treepath" value="'+treepath+'">
// if it set to true
var rememberLastVisited = false;

// saves the label which is currently shown
// used in the parts.js
// .... the funtion belTreeLabel() sets this variable....
var currentLabel = "";  

// contains all available languages
// when passed to an PartsApplet using the "languages"-param, the
// first entry will be the default language
var availableDataLanguages = "de_de,en_gb,es_es,fr_fr,nl_nl,it_it";

// contains all available GUI languages
// first entry will be the default language
var availableGUILanguages = "de_de,en_gb,es_es,fr_fr,nl_nl,it_it";

// define here the standard frame width of the tree frame
// with which it will be initialize
// this value will be set to the state.js in the var currentTreeFrameWidth which is used for recall the current frame width
var treeFrameWidth = "222"; //pixel

// define here the standard frame height of the toolbar frame
var toolbarFrameHeight = "23";

// define here the standard frame height of the partsdrawing frame
var partsDrawingHeight = "70%";

// with this flag u can switch between the both possibilities of sending the cart to the sap-system
// zero (0) means the standard way of sending, a normal html form &
// one (1) means send it as a xml (xml_type="ESAPO")
// used in order.html... for switching...
var oci_sendSwitcher = 0;

// here you can define, the parameters which should not transferred to the oci interface
var unallowedOCIParams = new Array('language', 'dataLanguage');

// here you can define the properties of the label, how it will be displayed
// used from the methode getPrintLabel();
// (used in drawing_print.html);
var maxShownParentLabels = 3; // the number of parents whose labels will be displayed
var maxLengthOfStr = 50; // the max size of the string, before he will cut
var shownDots = 3; // how many dots should be shown, if the string is to long

// in the follow two variables you can define how often & how fast the basket button will flash
// if something will be added to the basket
var flashs = 2; // how often
var flashDelay = 50; // how fast

// shows the customer, that the basket is already filled
// the small rectangle in the basket button
var fullBasketTwinkle = 10; // how often
var fullBasketDelayOnInit = 250; // how fast

//disable or enable the printServer functionality
// false means off
// true means on 
var printServerSwitcher = false;

// define here, the address of the servlet which handels the print jobs
 var printServerURL = "http://demo-2000:8100/printserver/printsessions.jsp";
 
 // insert here the names of the windows which sould shonw in the tab registry
var useTabManager = false;//true;
var tabManagerFrameHeight = 190;
var maxTabsSize = 7;

