var repository="http://www.linde-gas.de/international/web/lg/de/likelgde30.nsf/RepositoryByAlias/Like20Std/$FILE/";
var repository1="http://www.linde-gas.de/international/web/lg/de/likelgde30.nsf/RepositoryByAlias/Like20Std1/$FILE/";
var repository2="http://www.linde-gas.de/international/web/lg/de/likelgde30.nsf/RepositoryByAlias/Like30Std/$FILE/";
var dbPath="http://www.linde-gas.de/international/Web/LG/DE/likelgde30.nsf";
// Will check if site is framed and break out. (Except where there are i-frames, then the name must be "likeframe")
if (window.name != "likeframe") {
	if (window != top) { top.location.href = location.href }
}
// Redirects the page to ../docbyalias/xxx if the full path is not included in the url
myurl=document.URL.toLowerCase();
validpages = new Array(".nsf/docbyalias/",".nsf/0/",".nsf/$$search",".nsf/(searchview)",".nsf/(agentslocator)","sitemap.html",".nsf/order",".nsf/contact",".nsf/wcc_contact",".nsf/confirmation");
doredirect = 1;
for (i=0;i<validpages.length;i++) {
	if (myurl.indexOf(validpages[i]) != -1) {
		doredirect = 0;
	}
}

// The following JavaScript function will determine if the browsers
// is IE version 4+ or Netscape version 4+
ns = false;
ie = false;
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Microsoft Internet Explorer")
		ie = true;
	if (navigator.appName == "Netscape")
		ns = true;
}
function SubTitleHeader(Subtitle)
{
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"line-mt\">");
	document.writeln("<tr><td><img border=\"0\" src=\""+repository+"line.gif\" width=\"30\" height=\"23\"></td>");
	document.writeln("<td class=\"line-txt\" width=\"100%\">"+Subtitle+"</td></tr>");
	document.writeln("<tr class=\"line-bgr\"><td><img border=\"0\" src=\""+repository+"trans.gif\" width=\"1\" height=\"1\"></td>");
	document.writeln("<td><img border=\"0\" src=\""+repository+"trans.gif\" width=\"1\" height=\"1\"></td></tr></table>");
}
function TopNextLinks(Next) {
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=right>");
	document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
	document.writeln("<td><img border=\"0\" src=\""+repository2+"pfeil_hoch_trans.gif\" width=\"5\" height=\"5\" style=\"margin-left:5px;margin-right:2px;\"></td><td><a href=\"javascript:window.scrollTo(0,0)\">Oben</a></td>")
	if (Next != "") {
	document.writeln("<td><img border=\"0\" src=\""+repository2+"pfeil_next_trans.gif\" width=\"5\" height=\"5\" style=\"margin-left:5px;margin-right:2px;\"></td><td><a href=\"#" + Next + "\">Weiter</a></td>")
	}
	document.writeln("</tr></table>")
	document.writeln("<br>")
	document.writeln("</td></tr></table>")
}
// Std function for opening pop-up windows. For example the contact forms
popupWins = new Array();
function windowOpener(url, name, args) {
	if ( typeof( popupWins[name] ) != "object" ) {
		popupWins[name] = window.open(url,name,args);
	} else {
		if (!popupWins[name].closed){
			popupWins[name].location.href = url;
		} else {
			popupWins[name] = window.open(url, name,args);
		}
	}
	popupWins[name].focus();
}
function doQuickSearch() {
	str = document.forms['QuickSearch'].elements['QuickSearchStr'].value;
	sortBy="&SearchOrder=4";
	start="&Start=1";
	count="&Count=50";
	
	if (str != "") {
		document.location.href=dbPath+"(SearchView)?SearchView&Query=("+str+")"+start+count+sortBy;
	} else {
		alert("Bitte geben Sie zuerst einen Suchbegriff ein.");
	}
}
// Creates code for inserting Flash element
function wFlash(file,w,h) {
	document.writeln("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ")
 	document.writeln("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" ")
	document.writeln("WIDTH=" + w +" HEIGHT=" + h +">")
	document.writeln("<PARAM NAME=movie VALUE=\"" + dbPath + file + "\">")
	document.writeln("<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>")
	document.writeln("<EMBED src=\"" + dbPath + file + "\" ")
	document.writeln("quality=high bgcolor=#FFFFFF  WIDTH=" + w + " HEIGHT=" + h + " TYPE=\"application/x-shockwave-flash\" ")
	document.writeln("PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">")
	document.writeln("</EMBED></OBJECT>")
}
// Creates code for inserting Windows Media element
function ctrlWindowsMedia(alias,action) {
	if (action == "play") {
		if (ie) {document.all[alias].play()}
	}
	if (action == "pause") {
		if (ie) {document.all[alias].pause()}
	}
	if (action == "stop") {
		if (ie) {document.all[alias].stop();document.all[alias].CurrentPosition = 0}
	}
	if (action == "rewind") {
		if (ie) {document.all[alias].CurrentPosition = 0}
	}
}
function wWindowsMedia(alias,file,w,h) {
	document.writeln("<center><table border=0 cellspacing=2 cellpadding=5><tr class=tab-bod><td valign=top align=middle>")
	document.writeln("<object id=\"" + alias + "\" width=\"" + w + "\" height=\"" + h + "\" ")
	document.writeln("classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" ")
	document.writeln("codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902\" ")
	document.writeln("standby=\"Loading Windows Media...\" type=\"application/x-oleobject\">")
	document.writeln("<param name=\"FileName\" value=\"" + dbPath + file + "\">")
	document.writeln("<param name=\"AutoStart\" value=\"true\">")
	document.writeln("<param name=\"ShowControls\" value=\"false\">")
	document.writeln("<embed type=\"application/x-mplayer2\" name=\"" + alias + "\" src=\"" + dbPath + file + "\" width=\"" + w + "\" height=\""+ h +"\" showcontrols=0 loop=false autostart=true ")
	document.writeln("pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\"></embed></object>")
	document.writeln("</td><tr class=tab-bod><td valign=top align=right>")
	document.writeln("<img class=\"btnWindowsMedia\" src=\"" + repository1 + "rewind.gif\" border=0 width=15 height=12 onClick=\"ctrlWindowsMedia('" + alias + "','rewind')\">")
	document.writeln("<img class=\"btnWindowsMedia\" src=\"" + repository + "blaettern_rechts.gif\" border=0 width=15 height=12 onClick=\"ctrlWindowsMedia('" + alias + "','play')\">")
	document.writeln("<img class=\"btnWindowsMedia\" src=\"" + repository1 + "pause.gif\" border=0 width=15 height=12 onClick=\"ctrlWindowsMedia('" + alias + "','pause')\">")
	document.writeln("<img class=\"btnWindowsMedia\" src=\"" + repository + "stop.gif\" border=0 width=15 height=12 onClick=\"ctrlWindowsMedia('" + alias + "','stop')\">")
	document.writeln("</td></tr></table></center>")
}
// Cookie functions
function setCookie(cookieName, cookieVal, days) {
	if (!days) days = 1;
	var expDate = new Date();
	expDate.setTime(expDate.getTime() + days*24*60*60*1000);
	var expDateString = expDate.toGMTString();
	document.cookie = cookieName + "="+escape(cookieVal) + ";path=/;expires="+expDateString;
}
function getCookie(cookieName) {
	cookieName = cookieName+"=";
	var allCookies = document.cookie;
	if (allCookies.length > 0) {
		var start = allCookies.indexOf(cookieName);
		if (start != -1) {
			start = start + cookieName.length;
			var end = allCookies.indexOf(";",start);
			if (end == -1) end = allCookies.length;
			return unescape(allCookies.substring(start,end));
		}
	}
	return null;		
}
function delCookie(cookieName) {
	document.cookie = cookieName + "=" + ";path=/;expires=Thu, 01-Jan-70 00:00:01 GMT";
}
// Generates a 30 digit random number used for tracking individual users in statistics
id = getCookie('session')
if (id == null) {
	id = ""
	for (i=0;i<30;i++) {
		tempid = Math.random()*10
		tempid = Math.floor(tempid)
		id = id + tempid
	}
	setCookie('session',id,365)
}
// Used in Sitemap to navigate main window.
function gotoPage(u) {
	if(top.opener!=null){
		top.opener.location.href = u;
	}
}
// Stores the last viewed pages in a cookie string. Used in tool subforms - params=Title, Alias, Flag (boolean flag if the list should be printed or only stored)
function doPageHistory(title,ref,flag) {
	myHistory = getCookie("pagehistory")
	list = new Array()
	if ((myHistory == null) || (myHistory == "")) {
		setCookie("pagehistory",title+"@"+ref,365)
		document.writeln("-")
		return true
	} else {
		list = myHistory.split("@")
		// Check if the list should be diplayed or not
		if (flag) {
			document.writeln("<table border=\"0\">")
			counter=1
			for (i=0;i<list.length;i+=2) {
				document.writeln("<tr><td><a class=\"info-form-links\" href=\""+dbPath+list[i+1]+"\">"+counter+". "+list[i]+"&nbsp;<img src=\""+repository2+"lnkArrowImg.gif\" border=\"0\"></a></td></tr>")
				counter++
			}
			document.writeln("</table>")
		}
		for (i=0;i<list.length;i+=2) {
			if (list[i+1] == ref) {
				list.splice(i,2)
				break
			}
		}
		list.unshift(title,ref) // Adds current to the top of the list
		if (list.length > 10) {
			list = list.slice(0,10)
		}
		// Add current page to list
		setCookie("pagehistory",list.join("@"),365)
	}
}
// Pop-up and pop-down abstract text when hovering navigation elements.
var flag = 1;
function navPopUp(text) {
	if ((ie) && (text != "") && (flag==1)) {
		myObj = document.all['navPopUpText'];
		myObj1 = document.all['navPopConnector1'];
		myObj2 = document.all['navPopConnector2'];
		myObj3 = document.all['navPopConnector3'];
		myObj4 = document.all['navPopArrow'];
		myObj1Y = (window.event.y - window.event.offsetY) + 6;
		myObj1.style.top = myObj1Y;
		myObj4.style.top = myObj1Y-3;
		myObj.style.top = myObj1Y - 100;
		myObj3.style.top = myObj1Y - 80;
		myObj2.style.top = myObj3.style.top;
		myObj2.style.height = 80;
		myObj.innerHTML = text;
		myObj.style.visibility = "visible";
		myObj1.style.visibility = "visible";
		myObj2.style.visibility = "visible";
		myObj3.style.visibility = "visible";
		myObj4.style.visibility = "visible";
	}
}
function navPopDown() {
	if ((ie) && (flag==1)) {
		myObj = document.all['navPopUpText'];
		myObj1 = document.all['navPopConnector1'];
		myObj2 = document.all['navPopConnector2'];
		myObj3 = document.all['navPopConnector3'];
		myObj4 = document.all['navPopArrow'];
		myObj.style.visibility = "hidden";
		myObj1.style.visibility = "hidden";
		myObj2.style.visibility = "hidden";
		myObj3.style.visibility = "hidden";
		myObj4.style.visibility = "hidden";
	}
}
// Jump script for WebSiteFinder Tool
function gotoSite(v) {
	if (v == "http://0") {
		return false;
	} else {
		window.open(v)
	}
}
// Secret................
if (document.layers) { document.captureEvents(Event.KEYPRESS); }
document.onkeypress = getKey;
// document.writeln("<div id=\"theegg\" style=\"position:absolute;top:50px;left:50px;z-index:999;padding:5px 5px 5px 5px;background:white;border:2 solid red;display:none;\">");
// document.writeln("<b style=\"cursor:hand;\" onClick=\"document.all['theegg'].style.display='none'\">Close</b><br><br>");
// document.writeln("<img src=\""+dbPath+"easteregg.jpg\">")
// document.writeln("</div>")
var secretString="lndkicksass";
var typedString="";
function getKey(keyStroke) {
	var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
	var keyString = String.fromCharCode(keyCode).toLowerCase();
	typedString+=keyString;
	if (typedString==secretString.substring(0,typedString.length)) {
		if (typedString==secretString) {
			if (ie) {
				window.status="Oops!! You found the secret key!";
				document.all['theegg'].style.display="inline";
			}
		}
	} else {
		typedString="";
	}
}
