/*===================================* 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.++++++++++++++++++++++++++++++++++++++++++++++++++++++++  KEEP TRACK OF ALL MODIFICATIONS!                   ++  IF A NEW VERSION IS INSTALLED, MODIFICATIONS MUST  ++  MANUALLY BE TRANSFERRED INTO THE NEW VERSION.      ++  BEST, SAFE A COPY TO A SECURE PLACE!               ++++++++++++++++++++++++++++++++++++++++++++++++++++++++THE PRODUCER:Andreas ImhofEDV-DienstleistungenCH-Guemligen, Switzerlandwww.aiedv.chVersion: 6.7Version date: 20100707===================================*//***************** * customizable functions for article text display * The functions below are called immediately before a clicked article is shown in the right float window. */// ******* clean out some unwanted text or turn what ever is neededfunction clean_content(thestr) {	var re = / \r\n/gi;	var content = thestr.replace(re," ");	re = / \r/gi;	content = content.replace(re," ");	re = / \n/gi;	content = content.replace(re," ");	//re = / \<br\>/gi;	//content = content.replace(re," ");	re = /-\<br\>/gi;	content = content.replace(re,"");	// kick out manually set font sizes	// uncomment to kick//	re = /font-size:(.)*?pt;/g;//	content = content.replace(re,"");	return(content);}// ******* suppress unwanted character attributes set manually from <spanfunction suppress_character_attribs(thestr) {	var suppress = "";	try { suppress = get_moreDocumentInfo("characterAttribsSuppress"); } catch(e){ return(""); }	if ((suppress == "0") || (suppress == "")) return(thestr);				// 0 = leave attribs as is				// 1 = remove font-family				// 2 = remove font-size	var supp = 0;	try { supp = parseInt(suppress); } catch(e) { return(thestr); }	if (supp == 0) return(thestr);	var str = thestr;	// nothing removed so far. add code here	return(str);}// ******* redirect certain oscommerce linksfunction redirect_oscommerce_links(thestr) {	if ((thestr == null) || (thestr == "")) return(thestr);	if (thestr.toLowerCase().indexOf("<a ") < 0) return(thestr);	// MUST BE LOWER CASE! because IE translates all tag names tu UPPER CASE!	str = thestr;	var re_lnk = null;	try {	// old IE 6 cant understand this		re_lnk = new RegExp("<a (.)*?\>","gi");		// get html <a href.....> construct		//re_lnk = /<a (.)*?\>/gi;		// get html <a href.....> construct	}	catch (e) { return (str); }	var a_link_re = re_lnk.exec(str);	var i = 0;		// just a security counter if the regexp can not replace some signatures	var last_found_pos = -1;	while ((a_link_re != null) && (a_link_re[0] != "")) {		var a_link = "" + a_link_re[0];	// the whole <a...> begin link string		var source_string = "advanced_search_result.php.keywords=";		var replace_string = "index\.php\?action=buy_now\&products_id=";		var re = new RegExp(source_string,"gi");		var pos = a_link.search(re);		//alert(a_link + "\n\n" + source_string + "\n\n" + pos);		if (pos >= 0) {			re = /href="(.)*"/;	// get the href attribute			var href_re = re.exec(a_link);			var href = "" + href_re[0];		// the whole href attribute			re = /"(.)*"/;					// get the url in the href attribute			var url_re = re.exec(href);		// the url only			var url = "" + url_re[0];		// ... as string			re = /"/g;						// remove double quotes			url = url.replace(re,"");			// change the progam call 'advanced_search_result.php?keywords=123456' to 'index.php?action=buy_now&products_id=123456'			re = new RegExp(source_string,"gi");			var new_url = url.replace(re,replace_string);						var new_link = "\<a href=\"javascript\:callURL('" + new_url + "',true,'ebshopwin')\" onClick=\"alert(lg[21][cur_lang_ID])\" title=\"" + lg[20][cur_lang_ID] + "\"\>";				re = /\?/g;						// escape ?			var esc_a_link = a_link.replace(re,"\\?");			var rex = new RegExp(esc_a_link);	// the whole original link must be replaced with the new link			str = str.replace(rex, new_link);				/*			re = /</g;			var lnk= a_link.replace(re,"W");			re = />/g;			lnk= lnk.replace(re,"W");			Response.Write(lnk + "<br>");			Response.Write(href + "<br>");			Response.Write(new_url + "<br>");			Response.Write(new_link + "<br>");			return;			*/		}		// find next html link construct		if (i > 1000) break;		a_link_re = re_lnk.exec(str);		i++;	}	return (str);}// ******* re-target links//         check, if links not pointing to this host address should be openened in new window (_target="_blank")var open_url_in_new_window = "";	// set to someting like ".mydomain.com"function retarget_links(thestr,internalURL) {	if ((internalURL == null) || (internalURL =="")) return(thestr);	if ((thestr == null) || (thestr == "")) return(thestr);	if (thestr.toLowerCase().indexOf("<a ") < 0) return(thestr);	// MUST BE LOWER CASE! because IE translates all tag names to UPPER CASE!	str = thestr;	var re_lnk = null;	try {	// old IE 6 can't understand this		re_lnk = new RegExp("<a (.)*?\>","gi");		// get html <a .....> link construct	}	catch (e) { return (str); }	var a_link_re = str.match(re_lnk);	// get all <a links	var i = 0;		// just a security counter if the regexp can not replace some signatures	var last_found_pos = -1;	while ((a_link_re != null) && (i < a_link_re.length) && (a_link_re[i] != "")) {		var a_link = "" + a_link_re[i];	// the whole <a ...> begin link string		//alert("link #"+i + " of " + a_link_re.length + "\n\n" + a_link);		if (a_link_re[i].indexOf("target=") > 0) {			i++;		// do nothing if already contains a target			continue;		}		if (a_link_re[i].indexOf("mailto:") > 0) {			i++;		// do nothing if email link			continue;		}		var source_string = "<a ";		var replace_string = "<a target=\"_blank\" ";	// set to '_top' or '_blank' or any window name		if (a_link_re[i].toLowerCase().indexOf(internalURL) > 0) {	// we want internal inks to show in same window _top			replace_string = "<a target=\"_top\" ";	// set to '_top' or '_blank' or any window name		}		var rel = new RegExp(source_string,"gi");		a_link_re[i] = a_link_re[i].replace(rel,replace_string);		a_link = a_link.replace("\?","\\?");	// escape question mark in source link		//alert("new link #"+i + " of " + a_link_re.length + "\nlink:\n" + a_link + "\nnew link:\n" + a_link_re[i]);		rel = new RegExp(a_link,"gi");		str = str.replace(rel,a_link_re[i]);		// process next html link construct		if (i > 1000) break;		i++;	}	return (str);}/***************** * customizable function for feature pop up. see arrow in top-right corner  * The function below are called after the flip book is loaded. */var flipbook_width_default_left = "";var flipbook_width_default_centered = "";var features_container = null;var overClearTimeout = null;	// for IE hack - what else?!!!!var keep_open = false;// ******* set up the features popup contentfunction init_features_popup() {	// check if we actually want the features popup	var features_pop = get_site_param("nofeatures");	if (features_pop != null) {		document.getElementById('features_container').style.display = "none";		return;	}	var features_pop = get_site_param("features");	if (features_pop == null) {		features_pop = get_css_value("show_features_pop","zIndex");		if ((typeof features_pop != "undefined") && (features_pop != "")) {	// found in css			if (parseInt(features_pop) != 1) {				document.getElementById('features_container').style.display = "none";				return;			}		}	}	// get default flipbook width for left position	var def_width = get_css_value("fb_body","width");	if ((typeof def_width != "undefined") && (def_width != "")) {	// found in css		flipbook_width_default_left = def_width;	}	// get default flipbook width for centered position	def_width = get_css_value("fb_body_center","width");	if ((typeof def_width != "undefined") && (def_width != "")) {	// found in css		flipbook_width_default_centered = def_width;	}	// now the popup content	do {		features_container = null;		try {			features_container = document.getElementById('features_container');		} catch (e) {}		if (features_container == null) break;		// IE6 hack		keep_open = false;	// for IE hack - what else?!!!!		if (document.all && (versionIE<7)) {			features_container.onmouseover = function() {				keep_open = true;				featuresPop_clearTimeout();				//document.getElementById('info1').innerHTML = "on td";				features_container.className="features_container_IE6hover";				};			features_container.onmouseout = function() { close_features_pop(); };		}		var fc = "";		fc += "<div class=\"features_link_r\" style=\"margin-top:0px;\"><a href=\"http://www.manuals.epaper-system.com/get_manual.php?f=BatchXSLT4Ind_HOWTO_en_htm\" target=\"_blank\">Online Manual English</a></div>";		fc += "<div class=\"features_link_r\" style=\"margin-top:0px;\"><a href=\"http://www.manuals.epaper-system.com/get_manual.php?f=BatchXSLT4Ind_HOWTO_de_htm\" target=\"_blank\">Online Handbuch Deutsch</a></div>";		fc += "<div class=\"features_title\">DEMO Settable Features</div>";		fc += "<div>Click the 'on/off' settings below<br> to modify the book view.</div><br>";		fc += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" style=\"vertical-align:top; white-space:nowrap;\">";			fc += "<tr><td colspan=\"2\">";				fc += "<table border=\"0\" style=\"vertical-align:top;\">";					fc += "<tr><td style=\"vertical-align:top;\"><span class=\"features_item_text_sb\">Book Theme:&nbsp;&nbsp;&nbsp;</span></td><td>";						fc += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"features_theme_table\" class=\"features_theme_table\" style=\"vertical-align:top; white-space:nowrap;\">";						fc += "<tr><td class=\"features_select\" onclick=\"bookTheme('" + xslcss_path + "flipbook.css')\">Standard gray</td></tr>";						fc += "<tr><td class=\"features_select\" onclick=\"bookTheme('" + xslcss_path + "fbtempl_std_gray_rpn.css')\">Standard gray, Thumbs right</td></tr>";						fc += "<tr><td class=\"features_select\" onclick=\"bookTheme('" + xslcss_path + "fbtempl_metal_gray.css')\">Metallic gray</td></tr>";						fc += "<tr><td class=\"features_select\" onclick=\"bookTheme('" + xslcss_path + "fbtempl_metal_gray_rpn.css')\">Metallic gray, Thumbs right</td></tr>";						fc += "</table>";					fc += "</td></tr>";				fc += "</table>";			fc += "</td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Book Window Position:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onclick=\"bookPos(0);\">&nbsp;left&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onclick=\"bookPos(1);\">&nbsp;center&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Book Width:&nbsp;&nbsp;&nbsp;</div></td><td><input id=\"flipbook_width_input\" value=\"" + flipbook_width_default_centered + "\" type=\"text\" class=\"features_input\">&nbsp;<a href=\"#\" class=\"features_item\" onclick=\"bookWidth(document.getElementById('flipbook_width_input').value);\">&nbsp;set&nbsp;</a>&nbsp;&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onclick=\"bookWidth('-1');\">&nbsp;reset&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text_sb\">Top Bar:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"topBar_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"topBar_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Lupe:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"lupe_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"lupe_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Document PDF:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"docPDF_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"docPDF_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Page Navigation:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"pageNav_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"pageNav_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Logo:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"logo_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"logo_off();\">&nbsp;off&nbsp;</a></td</tr>";			if (document.getElementById('ft_search_btn') != null) {				fc += "<tr><td><div class=\"features_item_text\">Search:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"search_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"search_off();\">&nbsp;off&nbsp;</a></td</tr>";			}			fc += "<tr><td><div class=\"features_item_text\">Title:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"title_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"title_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text_sb\">Page Thumbnails:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"thumbs_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"thumbs_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Page Title:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"pageTitle_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"pageTitle_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Page Toolbar:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"pageToolbar_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"pageToolbar_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text\">Info Message:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"message_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"message_off();\">&nbsp;off&nbsp;</a></td</tr>";			fc += "<tr><td><div class=\"features_item_text_sb\">Show Article in Window:&nbsp;&nbsp;&nbsp;</div></td><td><a href=\"#\" class=\"features_item\" onClick=\"articleWin_on();\">&nbsp;on&nbsp;</a>&nbsp;|&nbsp;<a href=\"#\" class=\"features_item\" onClick=\"articleWin_off();\">&nbsp;off&nbsp;</a></td</tr>";		fc += "</table>";		fc += "<div>This is a very small selection only.<br>For more options, please, read the manual.</div>";		features_container.innerHTML = fc;		// add some IE hacks		setTimeout("featuresPop_setHooks()",50);	} while(false);	return;}function close_features_pop() {	keep_open = false;	//document.getElementById('info1').innerHTML = "off td";	overClearTimeout = setTimeout("do_close_features_pop()",1000);}function do_close_features_pop() {	//document.getElementById('info1').innerHTML = "keep_open: " + keep_open;	if (!keep_open) { features_container.className="features_container"; }}function featuresPop_clearTimeout() {	keep_open = true;	if (overClearTimeout != null) { window.clearTimeout(overClearTimeout); overClearTimeout = null; }	//document.getElementById('info1').innerHTML = "featuresPop_clearTimeout - keep_open: " + keep_open + "\nobj: " + this;}function featuresPop_overContainer (elem) {	// show rows	var tds = elem.getElementsByTagName("td");	for (var i = 1; i < tds.length; i++) {		tds[i].style.display = "";	}	//document.getElementById('info1').innerHTML = "featuresPop_overItem\nevent.srcElement: " + elem + "\nevent.srcElement.id: " + elem.id;}function featuresPop_outContainer (elem) {	// hide rows	var tds = elem.getElementsByTagName("td");	for (var i = 1; i < tds.length; i++) {		tds[i].style.display = "none";	}	//document.getElementById('info1').innerHTML = "featuresPop_outItem\nsrcElement: " + elem + "\nsrcElement.id: " + elem.id;}function featuresPop_overItem (elem) {	featuresPop_clearTimeout();	elem.className = "features_select_hover";	//document.getElementById('info1').innerHTML = "featuresPop_overItem\nsrcElement: " + elem + "\nsrcElement.id: " + elem.id;}function featuresPop_outItem (elem) {	featuresPop_clearTimeout();	elem.className = "features_select";	//document.getElementById('info1').innerHTML = "featuresPop_outItem\nsrcElement: " + elem + "\nsrcElement.id: " + elem.id;}function featuresPop_setHooks() {	try {		var tbl = document.getElementById('features_theme_table');		tbl.onmouseover = function() { featuresPop_overContainer(this); };		tbl.onmouseout = function() { featuresPop_outContainer(this); };		var tds = tbl.getElementsByTagName("td");		if (tds) {			for (var i = 0; i < tds.length; i++) {				tds[i].onmouseover = function() { featuresPop_overItem(this); };				tds[i].onmouseout = function() { featuresPop_outItem(this); };				if (i >= 1) {					tds[i].style.display ="none";				}			}		}	} catch(e) {}}