var colors7=new Array("#B1D4FB","#EDC5FC","#EFFFD8","#FFCC6F")//blue pup green oranj
var colors=new Array("#D8EBFF","#E8D8FF","#EFFFD8","#FEEDC5")
var darkedcolors=new Array("#5A92CE","#8A5ACE","#9ECE5A","#E2AF3B")
var currentFile="searchjs.asp"
var myTempFocus=false
String.prototype.trim = function () { return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"); };
var ie=document.all
var ns6=document.getElementById && !document.all
var mySearchAreaName="mySearchArea";
var myPopUpName="myPopUp";
var searchBoxName="q";//your text box name
var searchBoxFormName="frm";//
var searchBoxID="";
var NetoRootPath="http://www.neto.co.il";
var clientFilesPath="/jsn-cgi/";
var clientImagesPath="http://www.neto.co.il";
/*var mySearchAreaWidth=250;
var popUpEnable=true;
var searchBoxHeight=20;//READ ONLY
var maxResult=10
var maxAdverResult=2
var maxNetoSearchResult=3
var netoPath=""
var rootdomainsname="http://www.neto.co.il"
var adverTemplate="<div class='netoAdverResultSpan'><a href='[clickurl]' class='netoAdverTitle'>[title]</a><div class='netoAdverDescription'>[description]</div>"
var NetoSearchTemplate="[ids]<div class='netoSearchResultSpan'><a href='[url]' class='netoSearchTitle'>[title]</a></div>[-ids]"
var netoSearchTitleMaxLength=30*/
//var curr_butt=2
//alert(colors[curr_butt])

function runSearch()
{
netoSearch.resultConnect.run();
//netoSearch.responseAnalys.start(netoSearch.searchBoxObject.value)
}


function tempFocus()
{
myTempFocus=true

}
function isEmpty()
{
if(document.frm.q.value=="")
return false
return true
}



function clearall()
{
netoSearch.resultConnect.results=[];
netoSearch.resultConnect.resultsAdver=[];
netoSearch.resultConnect.searches=[];
netoSearch.adverArea.innerHTML=""
netoSearch.phraseArea.innerHTML=""
netoSearch.searchNetoArea.innerHTML=""
netoSearch.searchNetoArea.innerHTML=""
}
function clearallW()
{
//netoSearch.resultConnect.results=[];
//netoSearch.resultConnect.resultsAdver=[];
netoSearch.adverArea.innerHTML=""
netoSearch.phraseArea.innerHTML=""
netoSearch.searchNetoArea.innerHTML=""
}
function helpClickFunct()
{
var newwind=window.open("jsn/help.html","helper","height=240,width=280,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,copyhistory=yes, resizable=yes'")
}

function netoCloseFunct()
{
netoSearch.mySearchAreaObject.style.display="none"
clearall()
}
function netoClickFunct()
{
location.href="http://www.neto.co.il"
}
function encode7(string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    }

function rover(cobj)
{
	//document.getElementById("wsp").innerHTML=document.getElementById("wsp").innerHTML+"<br>span over"
//netoSearch.displayedFlag=false;
//if(netoSearch.timeobject!=null)
//clearTimeout(netoSearch.timeobject)
cobj.className="phraseResultout"
}

function rout(cobj)
{
	//document.getElementById("wsp").innerHTML=document.getElementById("wsp").innerHTML+"<br>span out"
//netoSearch.displayedFlag=true;
//netoSearch.timeobject=setTimeout("netoSearch.hideArea()", netoSearch.timer);////////////////////////
cobj.className="phraseResultover"
}

function inserttex(thetex)
{
	if(netoSearch.searchBoxObject.value!="")
netoSearch.searchBoxObject.value=thetex//netoSearch.searchBoxObject.value+" "+thetex
//else
//netoSearch.searchBoxObject.value=thetex
netoSearch.mySearchAreaObject.style.display="none";
//alert(document.frm)
//document.frm.sbm.click
//document.getElementById("butt").click
//alert("ssss")

//document.getElementById('sbm').focus()
//document.getElementById("btt").click();
//uu()
//location="http://www.google.com"
var ffrms=document.getElementById('frm')
	//alert(ffrms)
ffrms.submit();
//returnValue = false;
//document.getElementById('hidl').click();

//yy()

//document.doSubmit();
//location=currentFile+"?q="+escape(thetex)
}
//document.doSubmit = function() {
    //document.getElementById("frm").submit();
//setTimeout("document.doSubmit();", 50);
//}

/*{
	alert("http://www.google.com")
location.href="http://www.google.com"
}*/
				

var netoSearch=null;//new searchArea.initial(mySearchAreaWidth,mySearchAreaName,myPopUpName,searchBoxName,searchBoxFormName,searchBoxID,popUpEnable,searchBoxHeight,maxResult);


function searchInit()
{
	if(document.getElementById("firstLineDecoration")!=null && typeof document.getElementById("firstLineDecoration") != "undefined")
		document.getElementById("firstLineDecoration").style.borderBottomColor=darkedcolors[curr_butt-1]
	if(document.getElementById("firstDivDecoration")!=null && typeof document.getElementById("firstDivDecoration") != "undefined")
		document.getElementById("firstDivDecoration").style.backgroundColor=colors[curr_butt-1]
	if(document.getElementById("firstDivDecoration2")!=null && typeof document.getElementById("firstDivDecoration2") != "undefined")
		document.getElementById("firstDivDecoration2").style.backgroundColor=colors[curr_butt-1]

	netoSearch=new searchArea.initial(mySearchAreaWidth,mySearchAreaName,myPopUpName,searchBoxName,searchBoxFormName,searchBoxID,popUpEnable,searchBoxHeight,maxResult);

	//searchArea.addFooter();//0=helper ; 1=company icon ;
	netoSearch.create();

	netoSearch.structure.enableNetoSearch()
	netoSearch.structure.enableAdver()
	netoSearch.structure.enableFooter(true)
	//if(netoSearch.mySearchAreaObject.value!="")
	//alert(myTempFocus)

	if(myTempFocus)
		netoSearch.resultConnect.run();
}

//peram=helper window
//netoSearch.reg();

 function decode7(utftext) {
        var string = "";
        var i = 0;
        var c = c1 = c2 = 0;

        while ( i < utftext.length ) {

            c = utftext.charCodeAt(i);

            if (c < 128) {
                string += String.fromCharCode(c);
                i++;
            }
            else if((c > 191) && (c < 224)) {
                c2 = utftext.charCodeAt(i+1);
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                i += 2;
            }
            else {
                c2 = utftext.charCodeAt(i+1);
                c3 = utftext.charCodeAt(i+2);
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                i += 3;
            }

        }

        return string;
    }




function viewSearchResult(objec,ids,cont,indres)
{
//var conteinleft=netoSearch.mySearchAreaObject.style.left.replace("px","").trim()
	//conteinleft=parseInt(conteinleft,10)
netoSearch.myPopUpObject.style.left="30px"//netoSearch.mySearchAreaObject.style.left+30//objec.offsetLeft-objec.offsetWidth
if(ie)
netoSearch.myPopUpObject.style.top=document.getElementById("phraseArea").offsetHeight+objec.offsetTop+17+"px"
	else
	netoSearch.myPopUpObject.style.top=objec.offsetTop+17+"px"//document.getElementById("adverArea").offsetTop-(10*ids)//+objec.offsetTop+5///+(10*ids)
	//alert(netoSearch.myPopUpObject.style.top)
	//alert(document.getElementById("phraseArea").offsetHeight+"\n"+objec.offsetTop)
	//alert(document.getElementById("phraseArea").offsetHeight)
	//else
//netoSearch.myPopUpObject.style.top=objec.offsetTop+objec.offsetHeight+10//document.getElementById("adverArea").offsetHeight+(ids*10)//10//+objec.offsetHeight+10+objec.offsetTop+
netoSearch.myPopUpObject.style.display="block"
//<a href='"+tempuri+"' class=popUpTitle>"+titl+"</a><div class=popUpDescription>"+tempdesc+"</div>"
//var descrippop="<a href='"+netoSearch.resultConnect.searches[indres][2]+"'  class=popUpTitle>"+netoSearch.resultConnect.searches[indres][1]+"</a><div class=popUpDescription>"+netoSearch.resultConnect.searches[indres][3]+"</div>"
var descrippop="<span  class=popUpTitle>"+netoSearch.resultConnect.searches[indres][1]+"</span><div class=popUpDescription>"+netoSearch.resultConnect.searches[indres][3]+"</div>"

//+""+netoSearch.resultConnect.searches[indres][2]+netoSearch.resultConnect.searches[indres][3]
netoSearch.myPopUpObject.innerHTML=descrippop
}

function hideSearchResult()
{
	netoSearch.myPopUpObject.style.display="none"
netoSearch.myPopUpObject.style.left=0
netoSearch.myPopUpObject.style.top=0

netoSearch.myPopUpObject.innerHTML=""
}



