// JavaScript Document


// ---------------------------------------------------------------------------------------------------------------------------------
/*
* MRO 23.06.10
* function for onresize() call
*/
// ---------------------------------------------------------------------------------------------------------------------------------
function calcIFrameHeight(frameID) 
{
  //find the height of the internal page
  var the_height = document.body.clientHeight -30 +"px";

  // alert("calcIFrameHeight the_height=" + the_height);

  //change the height of the iframe
  document.getElementById(frameID).style.minHeight=the_height;
}


// ---------------------------------------------------------------------------------------------------------------------------------
/*
* FL 19.06.10
* is used from Weiterleitung-index
*/
// ---------------------------------------------------------------------------------------------------------------------------------
  function createArbeitsBereich() 
  {

	tID = "nextPage";
	tMyURL = self.location.search;
	tStartIndex = tMyURL.indexOf("?");
	tNextPage="";

	if (tStartIndex!=-1) 
	{
		// URL enthaelt Parameter tID= suchen
		tString = tMyURL.substr(tStartIndex,tMyURL.length-tStartIndex);
		tStartIndex= tString.indexOf(tID+"=");

		if (tStartIndex!=-1) 
		{
			// tID= gefunden
			tStartIndex = tStartIndex+tID.length+1;
	   		tString = tString.substr(tStartIndex,tString.length-tStartIndex);
			
			// Wert aus String entnehmen
			if (tString.indexOf("&")!=-1) 
			{
				// Weitere Parameter folgen
				tNextPage=tString.substr(0,tString.indexOf("&"));
			}
			else
			{
				// tID ist letzter Parameter
				tNextPage=tString;
			}
		}
	}
	if (tNextPage.length >0)
	{
		tArbeitsBereich = "<iframe frameborder=0 scrolling='auto' src='PCDArbeitsBereich.htm?nextPage=" +  tNextPage + 
										"' class='framerIframe'  name='workFrame' id='mainframe'><a href='../PCDArbeitsBereich.htm?nextPage=\"" +  tNextPage + "\">Please click here.</a> </iframe>";
    }
	else
	{
		 	tArbeitsBereich = "<iframe frameborder=0 scrolling='auto' src='PCDArbeitsBereich.htm'" + 
										" class='framerIframe'  name='workFrame' id='mainframe'><a href='../PCDArbeitsBereich.htm'"  + "'>Please click here.</a> </iframe>";
	}
		// alert("tArbeitsbereich=" + tArbeitsBereich);
		document.write(tArbeitsBereich); 
  }



// ---------------------------------------------------------------------------------------------------------------------------------
/*
* FL 19.06.10
*/
// ---------------------------------------------------------------------------------------------------------------------------------
function createIframeDynamicHeight() 
  {

	 // alert("document.body.location=" + document.location);
/*	
	var tFooter       = document.getElementById("footer");
	var tFooterHeight = tFooter.clientHeight;
	// alert ("Element=" + tFooter.id +".clientHeight=" + tFooterHeight);

	var tSearch 	  = document.getElementById("search");
	var tSearchHeight = tSearch.clientHeight;
	// alert ("Element=" + tSearch.id +".clientHeight=" + tSearchHeight);

	var tMainframe = document.getElementById("mainframe");
	var tMainframeHeight = tMainframe.clientHeight;
	// alert ("Element=" + tMainframe.id +".clientHeight=" + tMainframeHeight);
*/

	//alert("document.body.clientHeight="  + document.body.clientHeight);
	var tTotalHeight = document.body.clientHeight -30 +"px";
	// alert ("totalHeight=" +tTotalHeight);

	document.write('<iframe frameborder="0" scrolling="auto" src="PCDArbeitsBereich.htm" class="framerIframe" Style="min-height:' + tTotalHeight + 
				   '" name="workFrame" id="mainframe"><a href="PCDArbeitsBereich.htm?unterMenue=NO">Please click here.</a> </iframe>');
   
}


// ---------------------------------------------------------------------------------------------------------------------------------
/*
* FL 19.06.10
*/
// ---------------------------------------------------------------------------------------------------------------------------------
function createIframeDynamicHeightForum() 
  {
	//alert("document.body.clientHeight="  + document.body.clientHeight);
	var tTotalHeight = document.body.clientHeight -30 +"px";
	// alert ("totalHeight=" +tTotalHeight);
	
	document.write('<iframe frameborder="0" scrolling="auto" src="http://www.boxster-group.de/ubb/ubbthreads.php" class="framerIframe" Style="min-height:' + tTotalHeight + 
				   '" name="workFrame" id="mainframe"><a href="http://www.boxster-group.de/ubb/ubbthreads.php">Please click here.</a> </iframe>');
   




// ---------------------------------------------------------------------------------------------------------------------------------
/*
* ???
*/
// ---------------------------------------------------------------------------------------------------------------------------------
function fitFrameFromParent(iHeight)
{
    addContextDebug("iHeight", iHeight);

    var elm = document.getElementById("mainframe");
    var footer = document.getElementById("footer");
    var search = document.getElementById("search");

    if (elm) {
        addContextDebug("enteredElm", true);
        elm.style.height = (iHeight + 40 + 140) + "px";
        if (search) { search.style.display = "none"; }
        footer.style.bottom = "-1px";
        if (search) { search.style.display = "block"; }
        addContextDebug("finishedElm", true);
    }
}}



// ---------------------------------------------------------------------------------------------------------------------------------
/*
* FL 19.06.10
* is used from Weiterleitung-PCDArbeitsBereich
*/
// ---------------------------------------------------------------------------------------------------------------------------------
  function nextPageOpen() 
  {

	tID = "nextPage";
	tMyURL = self.location.search;
	//alert("tMyURL=" + tMyURL);
	tStartIndex = tMyURL.indexOf("?");
	//alert ("tStartIndex=" + tStartIndex);
	tNextPage="";

	if (tStartIndex!=-1) 
	{
		// URL enthaelt Parameter tID= suchen
		tString = tMyURL.substr(tStartIndex,tMyURL.length-tStartIndex);
		tStartIndex= tString.indexOf(tID+"=");

		if (tStartIndex!=-1) 
		{
			// tID= gefunden
			tStartIndex = tStartIndex+tID.length+1;
	   		tString = tString.substr(tStartIndex,tString.length-tStartIndex);
			
			// Wert aus String entnehmen
			if (tString.indexOf("&")!=-1) 
			{
				// Weitere Parameter folgen
				tNextPage=tString.substr(0,tString.indexOf("&"));
			}
			else
			{
				// tID ist letzter Parameter
				tNextPage=tString;
			}
		}
	}
	if (tNextPage.length >0)
	{
		 // alert('tNextPage=' + tNextPage);
	     window.open(tNextPage,'_blank');
		 // document.location.href = tNextPage;
    }
	else
	{
		 // alert('tNextPage is Null');
	}
  }

// -----------------------------------------------------------------------------------------------------------------------------------
/*
*	FL 19.06.10
*/
// -----------------------------------------------------------------------------------------------------------------------------------

function startSearch() 
{		
	/* FL 19.06.10 - not in use 

	var urlBegin = containsStr(document.location.href, "pc_main") ? 
		strLeftBack(strLeftBack(document.location.href, "nsf"), ".") + ".nsf/" : 
		strLeftBack(strLeftBack(document.location.href, "nsf"), "/") + "/pc_main.nsf/";
	*/
	
	var term = encodeURIComponent(document.forms["searchform"].query.value);
		alert ("Suche ist nicht verfuegbar: <" + term + ">");

	/*
	var action = urlBegin + "SearchResult?OpenNavigator&search=" + term; 
	document.location.href = action;	
	
	*/
}


