
<!-- Begin
	// The parameter passed to doSearch() is ignored until
	// the WDTs are changed to pass in the correct product.
	// For now, the product is hard-coded into each search.js
	// for each doc set.

	prod = "wlp";

	// The doSearch function needs to open the file
	//     PRODUCT/doc70/search/search_offline_main.html
	// 
	// For PRODUCT/doc70/index.html       (0 levels down from docs70)
	// we use            search/search_offline_main.html
	// 
	// For PRODUCT/doc70/intro/index.html (1 level  down from docs70)
	// we use         ../search/search_offline_main.html
	//
	// This code determines how many "../"s we need.
	//
	dotdot = document.location.href;
	//
	// for CD search
	re = new RegExp( ".*docs70\/", "i" );
	dotdot = dotdot.replace( re, "" )
	//alert( "dotdot="+dotdot);
	re = new RegExp( "[^/]*\/", "g" );
	dotdot = dotdot.replace( re, "../" )
	//alert( "dotdot="+dotdot);
	re = new RegExp( "[a-zA-Z].*", "i" );
	dotdot = dotdot.replace( re, "" )
	//alert( "dotdot="+dotdot);

	var now=(new Date()).getTime();
	var net_up = false;
	function im_good() {
	    //alert( 'good' );
	    net_up = true;
	}
	function im_bad() {
	    //alert( 'bad' );
	    net_up = false;
	}
	var im = new Image
	im.onload = im_good
	im.onerror = im_bad
	im.src = 'http://edocs.bea.com/images/blank.gif?' + now;

	// This function is called by the child window that handles CD searches
	function getSearchText() {
	    return document.forms[0].search_text.value;
	}

	function doSearch(area) {
	    area = area.toLowerCase();
	    // The parameter passed to doSearch() is ignored until
	    // the WDTs are changed to pass in the correct product.
	    // For now, the product is determined from the path of the 
	    // current page.
	    // NOTE:  This workaround may actually be preferrable
	    // to fixing the WDTs, provided the paths are predictable.
	    area = prod;

	    dir = area;
	    if	    ( "weblogic"    == area ) dir = "wls";
	    else if ( "integration" == area ) dir = "wli";
	    else if ( "portal"	    == area ) dir = "wlp";

	    var debug = false; // TODO FIX change 'true' to 'false' for production
	    if ( net_up && debug ) {
		if ( false == confirm( "REMOVE THIS MESSAGE FOR PRODUCTION.\nNetwork is available.  Click OK to search on-line docs.  Click Cancel to search CD docs." ) )
		    net_up = false;
	    }
	    //alert( 'net_up=' + net_up );
	    if ( net_up ) {
		var theEntry=getSearchText();
			
		// search for any blank spaces and replace with '+'	
		var pattern = /\b \b/ig;
		var theQuery = theEntry.replace(pattern,"+");

		//alert( "redirecting...");
		if ( area == "platform" ) {
		    //alert("testing");
		    document.location="http://search.bea.com/platform/go70/query.html?col=edocs&qp="+"url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fplatform%2Fdocs70%2F%2C"+"url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwls%2Fdocs70%2F%2C"+"url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwli%2Fdocs70%2F%2C"+"url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwlp%2Fdocs70%2F%2C"+"url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fworkshop%2Fdocs70%2F"+"&qt="+theQuery+"&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0";
		    //document.location="http://search.bea.com/platform/go70/query.html?col=edocs&qp=url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwlintegration%2Fv2_1%2F%2Curl%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwls%2Fdocs70%2F&qt="+theQuery+"&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0";
		    ////document.location="http://search.bea.com/platform/go70/query.html?col=edocs&qp=url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwlintegration%2Fv2_1%2F&qp=url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwls%2Fdocs70%2F&qt="+theQuery+"&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0";
		    //document.location="http://search.bea.com/platform/go70/query.html?col=edocs&qp=url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwls%2Fdocs70%2F%2Chttp%3A%2F%2Fe-docs.bea.com%2Fwls%2Fdocs70%2F&qt="+theQuery+"&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0";
		    //document.location="http://search.bea.com/platform/go70/query.html?col=edocs&qp=url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwls%2Fdocs70%2F&qt="+theQuery+"&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0";
		    //document.location="http://search.bea.com/weblogic/go70/query.html?col=edocs&qp=url%3Ahttp%3A%2F%2Fe-docs.bea.com%2Fwls%2Fdocs70%2F&qt="+theQuery+"&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0";
		} else {
		    document.location="http://search.bea.com/"+dir+"/go70/query.html?col=edocs&qp=url%3Ahttp%3A%2F%2Fe-docs.bea.com%2F"+area+"%2Fdocs70%2F&qt="+theQuery+"&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0";
		}
		//alert( "redirected");
	    } else {
		window.open( dotdot + "search/search_offline_main.html", "subwin");
	    }
	    return false;
	}

// End -->
