var ActiveForm;
var ActiveDiv;
var ActiveInput
var HiddenInput;
var url;
var clear;
var strHTML;
var DateDiff;

function SearchFilter(FilterType, FilterValue){	
	var sDestURL='';
	
	switch(FilterType){
		case 'crawler': {
			sDestURL = 'http://crawler.nana10.co.il/cgi-bin/texis/co.il/search?string='+FilterValue+'&criteria=and';
			break;
		}
		default:
			sDestURL = ReplaceURLParam(FilterType,FilterValue);
			break;			
	}
	document.location.href = sDestURL;
}
// Replace given parameter value in the url query string	
function ReplaceURLParam(param, value){
	
	var arrHref=null;
	var sCurrentPage='';
	var sQueryString='';
	var sLink = document.location.href;
	var nCharPos=0;
	var nParamLen=0, nValueLen=0;
		
	arrHref = sLink.split("?");
	sCurrentPage = arrHref[0]+"?";
	if(arrHref.length>0) sQueryString=arrHref[1];
		
	nParamLen = param.length;
	nValueLen = value.length;	
	nCharPos = sQueryString.indexOf("&"+param+"=");	

	if(nCharPos>-1)	
		sQueryString=sQueryString.slice(0,nCharPos)+sQueryString.slice(nCharPos+2+nParamLen+nValueLen);
	else
		if(sLink.indexOf("category.asp")>-1&&param=="cat") return(sLink);
		
	return(sCurrentPage+sQueryString+'&'+param+'='+value);
}



	function ss(w){window.status=w;return true;}
	function cs(){window.status='';}
 
 
 
 
 
 
// ------------------------- REGION : VELINGO ---------------------------
// ----------------------------------------------------------------------

//This fille will send HTTP post to Velingo for ststistics
//Created on 12/07/07 by Nava Granot
//Updated on 09.09.2007 by Kossovsky Alexander
//	-- serviceURL
//=============================================================

// Velingo Statistics 
var LICENSE_KEY = "5dc17d2f4e72eda51f68:6"; 
//var serviceURL = "http://index"+ sEnvironment +".nana10.co.il/velingo/VelingoRedirect.asp";
var serviceURL = "/common/velingo/VelingoRedirect.asp";

// Uses AJAX to send an asynchronous call to the VTS, to report a result hit event 
function clickResult(sQuery, sUrl) {
//alert(sUrl + '---' + sQuery);
//var element = event.srcElement; 
var objXMLHttp;
var userAgent;

	try {
		
			objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
			userAgent = "Internet%20Explorer";	
		}
	catch (e) 
		{
			try {
					objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
					userAgent = "Internet%20Explorer";
				} 
			catch (e)
				{
					try	{
							objXMLHttp = new XMLHttpRequest();
							userAgent = "Mozilla/5.0";		
						}			
					catch(e)
						{
							alert("Your browser does not support AJAX!");
							return false;        
						}
						
				}
		}

if (objXMLHttp==undefined) return false;
  

/*
	
	try {    
		objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");

		userAgent = "Internet%20Explorer"; 
	} catch (e) {    	   
		try {
			objXMLHttp = new XMLHttpRequest(); 
			userAgent = "Mozilla/5.0";
		} catch (e) {
			alert("Your browser does not support AJAX!");
			return false;        
		}      
	}
	
*/	
	
	sQuery = sQuery.replace(/ /g,"^");
	var requestBody = "event=1" +
	"&license=" + LICENSE_KEY + 
	"&query=" + sQuery + 
	"&url=" + escape(sUrl);
	
	
	objXMLHttp.open("POST", serviceURL, true);
	objXMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=windows-1255");
	objXMLHttp.send(requestBody);
	//var ttt = objXMLHttp.responseText;
	//alert(ttt);
	return false;
}

// ------------------------- REGION : COLLARITY ---------------------------
// ----------------------------------------------------------------------

// ARTICLES
function _sf(pos,el, q){
try{
	//debugger;
    if(document.images){ 
            var n=document.getElementById("sf_s"+pos);
            (new Image()).src="http://api.collarity.com/cws/v1/sf?appid=nana10_" + sCollarityContentGroup
                            +"&p="+pos
                            +"&q="+q
                            +"&u="+encodeURIComponent(el.href)
                            +"&t="+encodeURIComponent(el.firstChild.nodeValue)
                            +"&s="+(n?encodeURIComponent(n.innerHTML):"");
                        
    }
  }catch(e){}
  return true;
}
 