/*===================================* 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 functions below are called immediately before a clicked article is shown in the right float window.THE PRODUCER:Andreas ImhofEDV-DienstleistungenCH-Guemligen, Switzerlandwww.aiedv.chVersion: 6.57Version date: 20090930===================================*/// ******* 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,"");	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function retarget_links(thestr) {	// remove this return and adjust links below	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(".lbe.de") > 0) {	// we want internal lbe.de links 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);}
