/* ====================================================================== * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED.  IN NO EVENT SHALL THE PRODUCER OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE.THE PRODUCER:Andreas ImhofEDV-DienstleistungenCH-Guemligen, Switzerlandwww.aiedv.chVersion: 1.0Version date: 20081011======================================================================*//***************************************** * * Shop Button Stuff from eBook seen in a frame * */ /* language dependent strings array where languages are like this:shtxt[0][0]="english";shtxt[0][1]="deutsch";shtxt[0][2]="francais";shtxt[0][3]="dansk";*/var num_shoptext_items=5;	//number of language dependent string array elementsvar shtxt=new Array(num_shoptext_items);for (var i=0; i<num_shoptext_items; i++) { shtxt[i]=new Array(4) }	//prepare sub-arrays for 4 languagesshtxt[0][0]="Go to the Shop";			// the title tag to show when mouse is over 'go shop' buttonshtxt[0][1]="Gehe zum Warenkorb";shtxt[0][2]="Aller au panier";shtxt[0][3]="Go to the Shop";shtxt[1][0]="http://www.schaffner-signalisation.ch/shop/shopping_cart.php";	// the shop URL shtxt[1][1]="http://www.schaffner-signalisation.ch/shop/shopping_cart.php";shtxt[1][2]="http://www.schaffner-signalisation.ch/shop/shopping_cart.php";shtxt[1][3]="http://www.schaffner-signalisation.ch/shop/shopping_cart.php";shtxt[2][0]="You must enable Cookies and Session Cookies to use the Shop!";shtxt[2][1]="Sie m\u00fcssen Cookies und Session-Cookies erlauben um den Shop zu benutzen!\nExtras -> Internetoptionen -> Datenschutz -> Erweitert";shtxt[2][2]="You must enable Cookies and Session Cookies to use the Shop!";shtxt[2][3]="You must enable Cookies and Session Cookies to use the Shop!";var shop_doc_loc = window.location.hrefvar shop_root = shop_doc_loc.substr(0,shop_doc_loc.toLowerCase().indexOf("/data/"));var shop_incpath = shop_root + "/shop/inc/";	// the 'inc' pathvar shop_WindowName = "ebshopwin";var shop_Window = null;var shop_language = "en";var shop_languageID = 0;var isIE = false;if (navigator.appName.toUpperCase().indexOf("EXPLORER")>-1) isIE = true;// init the shop button stuff - call from loader flipbook.jsfunction init_shop(language,languageID) {	// try to find the shop stuff	//document.getElementById("info").innerHTML = shop_doc_loc + "<br>" + shop_root + "<br>" + shop_incpath + "<br>" + shop_language;	shop_language = language;	shop_language_ID = languageID;	var shop_img = new Image();	if ( (navigator.userAgent.toUpperCase().indexOf("MSIE") > -1) || (navigator.userAgent.toUpperCase().indexOf("SAFARI") > -1) ) {		shop_img.onload=function(){ enable_shop(); };		shop_img.onerror=function(){ disable_shop(); };	}	else {		shop_img.setAttribute("onload","enable_shop();");		shop_img.setAttribute("onerror","disable_shop()");	}	shop_img.src = shop_incpath + "Shop_en.gif";	// check if session cookies are enabled!	// otherwise the shop will not work, will show the currently selected item only and forget about all others	var cookiesOK = are_cookies_enabled();	if (cookiesOK == false) {		alert(shtxt[2][shop_language_ID]);	}	return;}function enable_shop() {	// shop system IS reachable	// add the shop button	var shop_btn_name = "Shop_" + shop_language + ".gif";	var shop_button_command = "<a href=\"#\" onclick=\"return open_shopWin()\" class=\"shop_btn_link\" title=\"" + shtxt[0][shop_language_ID] + "\"><img class=\"shop_btn_img\" src=\"" + shop_incpath + shop_btn_name + "\" onclick=\"try{this.blur();}catch(e){}\" alt=\"" + shtxt[0][shop_language_ID] + "\"></a>";	// add a td in the page navigation header	var shop_td = document.createElement("td");	var shop_id_attr = document.createAttribute("id");	shop_id_attr.nodeValue = "shop_btn";	shop_td.setAttributeNode(shop_id_attr);	var shop_class_attr = document.createAttribute("class");	shop_class_attr.nodeValue = "shop_td";	shop_td.setAttributeNode(shop_class_attr);	var shop_btn = document.createTextNode("");	shop_td.appendChild(shop_btn);	document.getElementById("title_td").parentNode.insertBefore(shop_td, document.getElementById("title_td"));	document.getElementById("shop_btn").innerHTML = shop_button_command;}function disable_shop() {	// shop system NOT reachable - we do nothing	//alert("NO shop reachable");}function open_shopWin() {	// if shop and eBook are in same frame set we slide the frames	if (have_frames) slide_workframe();	else {	// the shop is not in a frame		if ( (shop_Window != null) && (shop_Window.closed == false) ) {			try{				shop_Window.focus();				//alert("shop  focused");				return(true);			}			catch (e) { }	// fall through to open the shop window		}		shop_Window = window.open("",shop_WindowName,"width=900,height=600,top=20,left=10,dependent=no,location=yes,menubar=yeso,resizable=Yes,scrollbars=Yes,status=yes,titlebar=yes,toolbar=yes");		shop_Window.location.href = shtxt[1][shop_language_ID];		shop_Window.focus();	}	return(true);}/***************************************** * *  slide open or close the 'shop window' within the main frame structure 'topframeset' * */// by default we have the frame rows within 'topframeset'://                  'BXSLTflipWin'  'workframecontrol'  'ebshopwin'// identified by:        0              1                 2      // we have to open or close 'ebshopwin' and therefore set to zero/or reset size of all other rowsvar workcontrolframe = top.document.getElementById('workframecontrol');var global_id = -1;var toprowframes_id = -1;var pagesparentframes_id = -1;var ebshopwin_id = -1;var parent_frame_heights = null;var num_row_frames = 0;var have_frames = false;var frm_arr = null;var original_parent_frame_heights = null;var ebshopwin_isopen = false;if (parent.document.getElementById("topframeset")) {	have_frames = true;	parent_frame_heights = parent.document.getElementById("topframeset").rows.split(',');	num_row_frames = parent.document.getElementById("topframeset").childNodes.length;	workcontrolframe = top.document.getElementById('workframecontrol');	frm_arr = new Array(num_row_frames);	var i = 0; var j = -1;	for (i = 0; i < frm_arr.length; i++) frm_arr[i] = parent.document.getElementById("topframeset").childNodes[i].id;	// determine the actual id's of frames	j = -1;	for (i = 0; i < frm_arr.length; i++) {		if (frm_arr[i] == null) continue;		j++;		if (frm_arr[i] == "BXSLTflipWin") { ebookframe_id = j; }		if (frm_arr[i] == "workframecontrol") { workframecontrol_id = j; }		if (frm_arr[i] == "ebshopwin") { ebshopwin_id = j; }	}	original_parent_frame_heights = parent_frame_heights;}var slide_pixels = 15;						// slide open the frame step wiseif (slide_pixels <= 0) slide_pixels = 1000;	// immediate open the framevar slide_speed = 0;	// in ms//********************function slide_workframe() {	if (!have_frames) return;	//alert("original_parent_frame_heights: " + original_parent_frame_heights + 	//	"\nebookframe_id:" + ebookframe_id + "\nworkframecontrol_id:" + workcontrolframe.workframecontrol_id +"\nebshopwin_id:" + ebshopwin_id);	if (workcontrolframe.ebshopwin_isopen) {	// ebshopwin is open: hide the frame		slide_workframe_hide();	}	else {	// ebshopwin is closed: show it		slide_workframe_show();	}	return;}//********************function slide_workframe_hide() {	if (!have_frames) return;	//alert("hiding ebshopwin to: " + original_parent_frame_heights);	parent.document.getElementById("topframeset").rows = original_parent_frame_heights;	// set frames	workcontrolframe.ebshopwin_isopen = false;	return;}//********************function slide_workframe_show() {	if (!have_frames) return;	var current_frame_heights = new Array();	current_frame_heights[0] = "0";	current_frame_heights[1] = "24";	current_frame_heights[2] = "*";	//alert("workcontrolframe: " + workcontrolframe + "\nshowing ebshopwin to: " + current_frame_heights);	top.document.getElementById("topframeset").rows = current_frame_heights.join(',');	// set frames	workcontrolframe.ebshopwin_isopen = true;	if (isIE) {	// force a refresh for IE (shop content is on left side hidden		var shopw = window.open("",shop_WindowName);	// seems there is no other way		shopw.location.href = shtxt[1][shop_language_ID];	}	return;}//********************function are_cookies_enabled() {	var cookieEnabled = (navigator.cookieEnabled) ? true : false	//if not IE4+ nor NS6+	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 		document.cookie="testenabled"		cookieEnabled=(document.cookie.indexOf("testenabled")!=-1)? true : false	}	return (cookieEnabled);}/*********** NOT USEDvar visibleWindow = null;function callURL(url, show_in_new_window) {	if ( (url == null) || (url == "") ) return;	if (show_in_new_window == true) {		visibleWindow = window.open("",shop_WindowName,"top=20,left=10,location=Yes,resizable=Yes,scrollbars=Yes,status=Yes,toolbar=Yes,menubar=Yes");		visibleWindow.location.href = url;		visibleWindow.focus();	}	else {		parent.ebshopwin.location.href = url;	}	return;}function clear_numCartItems() {	if (parent.functbuttonswin.document.getElementById("numCartItems")) {		parent.functbuttonswin.document.getElementById("numCartItems").innerHTML = "";	}}function draw_shop_buttons() {	var cont = "";		// set go to shop button	document.write('<div class="functButtonsMargin"><img id="goShopBtn" src="../' + top.shop_folder + '/buttons/Shop_' + cur_lang + '.gif" onClick="javascript:callURL(\'http://www.schaffner-signalisation.ch/shop/\',false);javascript:parent.workframecontrol.slide_workframe()" onMouseOver="this.style.cursor=\'pointer\'" alt="' + ta[90][cur_lang_ID] + '" title="' + ta[90][cur_lang_ID] + '"><\/div>');		// set go to cart buttons	document.write('<img id="goCartBtn" src="../' + top.shop_folder + '/buttons/Cart_' + cur_lang + '.gif" onClick="javascript:callURL(\'http://www.schaffner-signalisation.ch/shop/shopping_cart.php\',false);parent.workframecontrol.slide_workframe()" onMouseOver="this.style.cursor=\'pointer\';" alt="' + ta[91][cur_lang_ID] + '" title="' + ta[91][cur_lang_ID] + '"><br>');	document.write('<div class="numCartItemsDiv" id="cartItemsContainer">');	document.write('<span class="numCartItemsSpan" id="numCartItems" title="' + ta[92][cur_lang_ID] + '" onClick="javascript:clear_numCartItems()" onMouseOver="this.style.cursor=\'pointer\'"><\/span>');	document.write('<\/div>');}**************/
