function objText(o)
{
	var s = new Array();
	s.push('{<br>');
	for ( var i in o )
		s.push("&nbsp;&nbsp;&nbsp;" + i + ": " + o[i] + "<br>");
	s.push('}');
	return s.join('');
}
function debug(msg)
{
	document.getElementById('debug').innerHTML += msg + "<br>";
}

function JSWindow(title, oContent, x, y)
{
	// save arguments
	this.title = title;
	this.oContent = oContent;

	// initialization	
	this.mx = 0;
	this.my = 0;
	
	// create table for window with title-bar and content
	this.oTable = document.createElement("table");
	this.oTable.border = 0;

	// set the position of the window
	this.oTable.style.position = "absolute";
	this.oTable.style.left = x + "px";
	this.oTable.style.top = y + "px";

	// set background to white (default is transparent)
	this.oTable.style.backgroundColor = "white";

	// link from the table to the JSWindow object
	this.oTable.jsWindow = this;

	// if anywhere in the table are is clicked, bring the window to front.
	this.oTable.onmousedown = JSWindow.prototype.onBringToFront;

	// append to document body
	document.body.appendChild(this.oTable);

	// add row for title bar
	var oTR = this.oTable.insertRow(0);
	oTR.className = "JSWindowTitleStyle";

	// title	
	var oTD = oTR.insertCell(0);
	oTD.innerHTML = title;
	oTD.jsWindow = this;
	oTD.onmousedown = JSWindow.prototype.tdOnMouseDown;
	
	// minimize
	//this.oMinTD = oTR.insertCell(1);
	//this.oMinTD.innerHTML = "";
	//this.oMinTD.onmousedown = JSWindow.prototype.onMinimize;
	//this.oMinTD.jsWindow = this;
	
	// close
	oTD = oTR.insertCell(1);
	oTD.innerHTML = "<center><FONT SIZE='2' color='#FFFFFF' face='Verdana, Arial, Helvetica, sans-serif' style='cursor: pointer;'><b>X</b></font></center>";
	oTD.jsWindow = this;	
	oTD.onmousedown = JSWindow.prototype.onClose;
	
	// add row for window content
	// a single cell the same width as the title bar row
	oTR = this.oTable.insertRow(1);
	oTD = oTR.insertCell(0);
	oTD.colSpan = 2;
	oTD.appendChild(oContent);
}

JSWindow.prototype.onBringToFront = function()
{
	this.jsWindow.bringToFront();
}
JSWindow.prototype.bringToFront = function()
{
	// if not already the last child of the document.body, make it so
	if ( document.body.childNodes[document.body.childNodes.length-1] !== this.oTable )
	{
		// move to bottom of document
		document.body.appendChild(this.oTable);
	}
}

JSWindow.prototype.tdOnMouseDown = function()
{
	this.jsWindow.onMouseDown();
}
JSWindow.prototype.onMouseDown = function()
{
	// record that an onmousedown has just occurred
	this.bDown = true;
	
	// link from body to this JSWindow object
	document.body.jsWindow = this;

	// save body mouse handlers
	this.saveMouseMove = document.body.onmousemove;
	this.saveMouseUp = document.body.onmouseup;

	// set new handlers.
	document.body.onmousemove = JSWindow.prototype.bodyOnMouseMove;
	document.body.onmouseup = JSWindow.prototype.bodyOnMouseUp;
}
JSWindow.prototype.bodyOnMouseMove = function(evt)
{
	var e = window.event ? window.event : evt;
	this.jsWindow.onMouseMove(e);
}
JSWindow.prototype.onMouseMove = function(evt)
{
	// if mouse not down, stop the move (for IE only)
	if ( (document.all) && !(evt.button & 1) )
	{
		this.onMouseUp();
		return;
	}
	if ( this.bDown )
	{
		this.dx = parseInt(this.oTable.style.left, 10) - evt.clientX;
		this.dy = parseInt(this.oTable.style.top, 10) - evt.clientY;
		this.bDown = false;
	}
	else
	{
		this.oTable.style.left = Math.max((this.dx + evt.clientX),0) + "px";
		this.oTable.style.top = Math.max((this.dy + evt.clientY),0) + "px";
	}
}
JSWindow.prototype.bodyOnMouseUp = function()
{
	this.jsWindow.onMouseUp();
}
JSWindow.prototype.onMouseUp = function()
{
	document.body.onmouseup = this.saveMouseUp;
	document.body.onmousemove = this.saveMouseMove;
	document.body.jsWindow = null;
}
JSWindow.prototype.onMinimize = function()
{
	this.jsWindow.minimize();
}
JSWindow.prototype.minimize = function()
{
	// hide the content
	this.oContent.style.visibility = "hidden";
	this.oContent.style.position = "absolute";
	document.body.appendChild(this.oContent);
	
	this.oTable.deleteRow(1);
	
	// save current position
	this.saveX = this.oTable.style.left;
	this.saveY = this.oTable.style.top;
	
	// get the "window bar"
	if ( !window.jsWindowBar )
	{
		window.jsWindowBar = document.createElement("span");
		document.body.appendChild(window.jsWindowBar);
	}
	
	window.jsWindowBar.appendChild(this.oTable);
	this.oTable.style.position = "static";
	this.oTable.style.left = "0px";
	this.oTable.style.top = "0px";
	
	this.oMinTD.innerHTML = "<center><FONT SIZE='2' color='#FFFFFF' face='Verdana, Arial, Helvetica, sans-serif' style='cursor: pointer;'><b>+</b></font></center>";
	this.oMinTD.onmousedown = JSWindow.prototype.onMaximize;
}
JSWindow.prototype.onMaximize = function()
{
	this.jsWindow.maximize();
}
JSWindow.prototype.maximize = function()
{
	document.body.appendChild(this.oTable);
	this.oTable.style.position = "absolute";
	
	this.oTable.style.left = this.saveX;
	this.oTable.style.top = this.saveY;
	
	// add the content again.
	oTR = this.oTable.insertRow(1);
	oTD = oTR.insertCell(0);
	oTD.colSpan = 3;
	
	oTD.appendChild(this.oContent);
	this.oContent.style.position = "static";
	this.oContent.style.visibility = "visible";
	
	this.oMinTD.innerHTML = "";
	this.oMinTD.onmousedown = JSWindow.prototype.onMinimize;
}
JSWindow.prototype.onMaximize = function()
{
	this.jsWindow.maximize();
}
JSWindow.prototype.close = function()
{	
	// remove content from browser document
	this.oContent.parentNode.removeChild(this.oContent);
	
	// remove from browser document
	this.oTable.parentNode.removeChild(this.oTable);
	
}

JSWindow.prototype.onClose = function()
{
	this.jsWindow.close();
	parent.location.href = document.location.href;
}

        var key = "";
        function makeEntry (){
                this.Name="";
                this.URL = "";
                this.Desc = "";
                this.Category = "";
                return this;
        }

 function makeArray(n) {
                this.length = n;
                for (var k = 1; k <= n; k++) {
                                this[k] = "";
                }
                return this;
        }               

        function makeLinks(size) {
                                this.length = size;
                                for (var r=1; r<= size; r++) {
                                                        this[r] = new makeEntry();
                                                        this[r].Name = namesArray[r];
                                                        this[r].URL = urlsArray[r];
                                                        this[r].Desc = descArray[r];
                                                        }
                                        return this;
                        }



var linksize=0 

datesArray = new makeArray(linksize);
namesArray = new makeArray(linksize);
urlsArray = new makeArray(linksize);
descArray = new makeArray(linksize);


var arraycount=0


arraycount += 1 
urlsArray[arraycount] = "../pages/main.asp?MenuId=1"
namesArray[arraycount] = "Home Page for BumpAds USA, LLC"
descArray[arraycount] = "what is bumpads home page main page search flash intro Page Tools Bookmark this page E-mail this Page Print this Page Contact BumpAds "

arraycount += 1 
urlsArray[arraycount] = "../pages/requestinfo.asp?MenuId=7"
namesArray[arraycount] = "Request Information"
descArray[arraycount] = "address help question questions contact request info request information Customer Support Issues Accounting  Billing Questions Sales Related Issues Questions About Your Order Reseller Questions email me email us e-mail me e-mail us address"

arraycount += 1 
urlsArray[arraycount] = "../pages/cancellation.asp?MenuId=7"
namesArray[arraycount] = "Cancellation Policy"
descArray[arraycount] = "cancel order cancellation of order"

arraycount += 1 
urlsArray[arraycount] = "../pages/legal.asp?MenuId=7"
namesArray[arraycount] = "Legal Information"
descArray[arraycount] = "legal copyrights disclaimer trademarks pdf restricted rights"

arraycount += 1 
urlsArray[arraycount] = "https://www.bumpads.com/pages/privacy.asp?MenuId=7"
namesArray[arraycount] = "Privacy Policy"
descArray[arraycount] = "privace statement security secured transactions encryption verisign Network Solutions SSL secure socket layer"

//arraycount += 1 
//urlsArray[arraycount] = "../MyPages/aboutus.asp?MenuId=2"
//namesArray[arraycount] = "About BumpAds"
//descArray[arraycount] = "BumpAds company profile principles about us Keyword Search"

//arraycount += 1 
//urlsArray[arraycount] = "../about/whatisbumpads.asp?MenuId=7"
//namesArray[arraycount] = "What Is A BumpAd?"
//descArray[arraycount] = "wheel stop wheelstop video movies before and after before & after"

arraycount += 1 
urlsArray[arraycount] = "../pages/propertyowners.asp?MenuId=2"
namesArray[arraycount] = "Property Owners"
descArray[arraycount] = "Property Owner Licensing Agreements Property Owner License Agreements Property Listings property owners replacement wheelstops passive income"

arraycount += 1 
urlsArray[arraycount] = "../pages/advertisers.asp?MenuId=3"
namesArray[arraycount] = "Advertisers"
descArray[arraycount] = "Advertiser Licensing Agreements Advertiser License Agreements Advertising advertiser ads income"

arraycount += 1 
urlsArray[arraycount] = "../pages/franchisees.asp?MenuId=4"
namesArray[arraycount] = "Franchisees"
descArray[arraycount] = "Franchisee Agreements Franchisees License Agreements Advertising advertiser ads income"

//arraycount += 1 
//urlsArray[arraycount] = "../pages/dealers.asp?MenuId=5"
//namesArray[arraycount] = "Dealers"
//descArray[arraycount] = "Dealer Licensing Agreements Dealer License Agreements Dealer Agreements sales"

arraycount += 1 
urlsArray[arraycount] = "../pages/contactus.asp?MenuId=7"
namesArray[arraycount] = "Directions to BumpAds"
descArray[arraycount] = "address map directions location phone number contact us hotels motels"

arraycount += 1 
urlsArray[arraycount] = "../pages/opendoclibraries.asp"
namesArray[arraycount] = "Document Libraries (Login Required)"
descArray[arraycount] = "Approval form Property Owner License Agreements Testimonial Property Owner Licensing Agreements Product Brochures Property Listings News Articles Press Releases Docs Documents Documentation library"

//arraycount += 1 
//urlsArray[arraycount] = "../MyPages/WhatsNew.asp?MenuID=1"
//namesArray[arraycount] = "BumpAds User News"
//descArray[arraycount] = "user news updates upgrades features product maintenance agreements annual license fees"

arraycount += 1 
urlsArray[arraycount] = "../pages/contactus.asp?MenuId=7"
namesArray[arraycount] = "Questions? Contact Us."
descArray[arraycount] = "address help question questions contact request info request information Customer Support Issues Accounting  Billing Questions Sales Related Issues Questions About Your Order FTP Related Issues Reseller Questions email me email us e-mail me e-mail us address"

arraycount += 1 
urlsArray[arraycount] = "../pages/careers.asp?MenuId=7"
namesArray[arraycount] = "Employment Opportunities"
descArray[arraycount] = "Receptionist Technical Support Representative Customer Service Billing Representative contact us career opportunities employees job options corporate trainer training graphic designers computer programmers marketing sales representative mis technician positions Career Application"

arraycount += 1 
urlsArray[arraycount] = "../pages/order.asp?MenuId=6"
namesArray[arraycount] = "Shopping Area - Purchase BumpAds Products"
descArray[arraycount] = "shop shopping purchase wheelstops wheel stops ads inserts buy place an order online"

//arraycount += 1 
//urlsArray[arraycount] = "../MyPages/sitemap.asp?MenuId=7"
//namesArray[arraycount] = "BumpAds Site Map"
//descArray[arraycount] = "site map sitemap end users dealer login search request information customer service security shipping manifest dealers corporate headquarters property owners License Agreements Advertiser Distributor Dealers Directions Libraries Library careers Employment Shopping More Information"

//arraycount += 1 
//urlsArray[arraycount] = "../manuals/manuals.asp?MenuId=6"
//namesArray[arraycount] = "BumpAds User Manuals"
//descArray[arraycount] = "user manuals users manuals user's manuals documentation installation instructions accounting software e-commerce data dictionary documents "

arraycount += 1 
urlsArray[arraycount] = "../main/login.asp"
namesArray[arraycount] =  "Frequently Asked Questions - Customer Login Required" 
descArray[arraycount] = "faqs"

arraycount += 1 
urlsArray[arraycount] = "../pages/moreinfo.asp?MenuId=7"
namesArray[arraycount] =  "Company Information" 
descArray[arraycount] = "More Information Company Information Contact Us Privacy Policy Legal Information Career Opportunities Office Directions Keyword Search Site Map"

arraycount += 1 
urlsArray[arraycount] = "../pages/register.asp"
namesArray[arraycount] =  "BumpAds Registration" 
descArray[arraycount] = "Sign Up signup register online registration BumpAds Member Property Owner Outlet Franchisee Advertiser Installer"

arraycount += 1 
urlsArray[arraycount] = "../pages/whyregister.asp"
namesArray[arraycount] =  "Why Register?" 
descArray[arraycount] = "Sign Up signup why register online registration BumpAds Member Property Owner Outlet Franchisee Advertiser Installer"


linksize = arraycount;

// ----end data -------


function searchLinks(links, keyword, place){
var dlg = document.createElement("div");
dlg.style.width = "760px";
var obj = document.getElementById(''+place+'');
var posX = obj.offsetLeft;var posY = obj.offsetTop;
while(obj.offsetParent){
posX=posX+obj.offsetParent.offsetLeft;
posY=posY+obj.offsetParent.offsetTop;
if(obj==document.getElementsByTagName('body')[0]){break}
else{obj=obj.offsetParent;}
}
wugga = posX + 3;
blah = posY + 90;
//dlg.style.height = "10px";
new JSWindow("<FONT face=verdana,sans serif COLOR=#FFFFFF size=2 style='cursor: move;'><strong>Search Results for Keyword: </strong></font><font color=#CCCCCC face=verdana,sans serif size=2><strong>" + document.getElementById('search').value + "</strong></font>", dlg, wugga, blah);
dlg.innerHTML += "<div id='div1' style='background-color: #FFFFFF;'>"; 

region = document.form.region.value;
txt = document.form.search.value.toLowerCase();
for (var q=1; q<=links.length; q++)
{

//dlg.innerHTML += "<center>";
        if (links[q].URL.toLowerCase().indexOf(keyword) != -1) {
dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href=" + links[q].URL + " id=cleanlink target='_top'><B>" + links[q].Name + "</B></a></font></td></tr></table>";
		continue;
         }
   
        if (links[q].Desc.toLowerCase().indexOf(keyword) != -1) {
dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><font face=verdana,sans serif size=2><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<a href=" + links[q].URL + " id=cleanlink target='_top'><B>" + links[q].Name + "</B></a></font></td></tr></table>";
		continue;
         }

        if (links[q].Name.toLowerCase().indexOf(keyword) != -1) {
dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href=" + links[q].URL + " id=cleanlink target='_top'><B>" + links[q].Name + "</B></a></font></td></tr></table>";
		continue;    
}

if ((txt.indexOf("faq") != -1) && (region == "E")) {
dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../faqs/eu/eufaqs.htm?MenuId=10' id=cleanlink target='_blank' onClick='self.close();'><B>End User Frequently Asked Questions</B></a></font></td></tr></table>";
		break;
		}

if ((txt.indexOf("frequent") != -1) && (region == "E")) {
dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../faqs/eu/eufaqs.htm?MenuId=10' id=cleanlink target='_blank' onClick='self.close();'><B>End User Frequently Asked Questions</B></a></font></td></tr></table>";
		break;
		}

		if ((txt.indexOf("question") != -1) && (region == "E")) {
dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../faqs/eu/eufaqs.htm?MenuId=10' id=cleanlink target='_blank' onClick='self.close();'><B>End User Frequently Asked Questions</B></a></font></td></tr></table>";
		break;
		}

		if ((txt.indexOf("newsletter") != -1) && (region == "E")) {
dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../main/viewdocs.asp?MenuId=5&Category=11' id=cleanlink target='_top'><B>End User Newsletters</B></a></font></td></tr></table>";
		break;
		}

//		if ((txt.indexOf("approval form") != -1) || (txt.indexOf("property owner") != -1) || (txt.indexOf("license agreements") != -1) || (txt.indexOf("testimonial") != -1) || (txt.indexOf("licensing agreements") != -1) || (txt.indexOf("product brochures") != -1) || (txt.indexOf("doc") != -1) || (txt.indexOf("property listings") != -1) || (txt.indexOf("press releases") != -1) || (txt.indexOf("license") != -1) || (txt.indexOf("licensing") != -1) && (region == "E")) {
//dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../pages/opendoclibraries.asp' id=cleanlink><B>Document Libraries</B> <i>(Login Required)</i></a></font></td></tr></table>";
//		break;
//		}

//if ((txt.indexOf("faq") != -1) && (region == "D")) {
//dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../faqs/dlr/dlrfaqs.htm?MenuId=10' id=cleanlink target='_blank' onClick='self.close();'><B>Dealer Frequently Asked Questions</B></a></font></td></tr></table>";
//		break;
//		}

//if ((txt.indexOf("frequent") != -1) && (region == "D")) {
//dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../faqs/dlr/dlrfaqs.htm?MenuId=10' id=cleanlink target='_blank' onClick='self.close();'><B>Dealer Frequently Asked Questions</B></a></font></td></tr></table>";
//		break;
//		}
//if ((txt.indexOf("question") != -1) && (region == "D")) {
//dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../faqs/dlr/dlrfaqs.htm?MenuId=10' id=cleanlink target='_blank' onClick='self.close();'><B>Dealer Frequently Asked Questions</B></a></font></td></tr></table>";
//		break;
//		}

//		if ((txt.indexOf("newsletter") != -1) && (region == "D")) {
//dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../main/viewdocs.asp?MenuId=8&Category=3' id=cleanlink target='_top'><B>Dealer/End User Newsletters</B></a></font></td></tr></table>";
//		break;
//		}

//		if ((txt.indexOf("7.3") != -1) && (region == "D")) {
//dlg.innerHTML += "<table border=0 width=100% cellpadding=2 cellspacing=2><tr><td valign=top bgcolor=#e9e9e9 align=left><img src=../images/arrowrt.gif border=0 name=arrow>&nbsp;<font face=verdana,sans serif size=2><a href='../main/viewdocs.asp?MenuId=8&Category=4' id=cleanlink target='_blank' onClick='self.close();'><B>Dealer/End User Newsletters</B></a></font></td></tr></table>";
//		break;
//		}


dlg.innerHTML += "</div>";
     }   
	
}

function check_empty(text) {
  return (text.length > 1); // returns false if less than 2 characters
}

function validate_form(where) {
   txt = document.form.search.value.toLowerCase();
   if (!check_empty(document.form.search.value))
        { validity = false; alert('Search field requires at least 2 characters!'); return;}
  if (txt.indexOf(",") != -1){
        alert("Search is invalid! Contains a ','"); return;}
  if (txt.indexOf("@") != -1){
        alert("Search is invalid! Contains a '@''"); return;}
  if (txt.indexOf("$") != -1){
        alert("Search is invalid! Contains a '$''"); return;}
  if (txt.indexOf("%") != -1){
        alert("Search is invalid! Contains a '%''"); return;}
  if (txt.indexOf("^") != -1){
        alert("Search is invalid! Contains a '^''"); return;}
  if (txt.indexOf("&") != -1){
        alert("Search is invalid! Contains a '&''"); return;}
  if (txt.indexOf("*") != -1){
        alert("Search is invalid! Contains a '*''"); return;}
  if (txt.indexOf("(") != -1){
        alert("Search is invalid! Contains a '(''"); return;}
  if (txt.indexOf(")") != -1){
        alert("Search is invalid! Contains a ')''"); return;}
  if (txt.indexOf("[") != -1){
        alert("Search is invalid! Contains a '[''"); return;}
  if (txt.indexOf("]") != -1){
        alert("Search is invalid! Contains a ']''"); return;}
  if (txt.indexOf(";") != -1){
        alert("Search is invalid! Contains a ';''"); return;}
  if (txt.indexOf(":") != -1){
        alert("Search is invalid! Contains a ':''"); return;}
  if (txt.indexOf("<") != -1){
        alert("Search is invalid! Contains a '<''"); return;}
  if (txt.indexOf(">") != -1){
        alert("Search is invalid! Contains a '>''"); return;}
  if (txt.indexOf("?") != -1){
        alert("Search is invalid! Contains a '?''"); return;}
  if (txt.indexOf("=") != -1){
        alert("Search is invalid! Contains a '=''"); return;}
  if (txt.indexOf("+") != -1){
        alert("Search is invalid! Contains a '+''"); return;}
  else {

rhs = new makeLinks(linksize);
        searchLinks(rhs,txt,where);
}

}




