	function getWindow(id, w) {
		window.open("http://www.opinion.co.il/ajax/send.asp?w="+w+"&id="+id, "AddNewOpinion", "resizable=0, width=500 ,height=520, scrollbars=0, status=0, location=0, menubar=0");
	}
	
	function qSearch(el)	{
	//el .href += "q="+document.getElementById("q").value;
	}

	function insertSearch(slct) {
	document.getElementById("w").value = slct
	}

	function RTL() {
	document.search_form.q.focus();
	}

var currect_qar="";
var global_url="http://www.opinion.co.il";
	function callStayOpen(){
		stayOpen=0;
	}

var urlSuggest = global_url+"/ajax/suggest.asp";
function suggestItems(qar, limit){
	var row=5;
	limit=5;
	var getTodayDate=new Date();
		//curr_open=0;
		currect_qar=qar;
		document.getElementById("i_recom_"+qar).innerHTML="";
		getInfo(urlSuggest + '?w=' + qar + '&row=' + row + '&colm=4&rand='+getTodayDate+'&limit=' + limit,"block","i_recom_"+qar);	
}

var urlOpinions = global_url+"/ajax/opinions.asp";
function opinionsItems(qar){
	limit=4;
	var getTodayDate=new Date();
		//curr_open=0;
		//document.getElementById("i_opinions_"+qar).innerHTML="";
		getInfo(urlOpinions + '?w=' + qar + '&rand='+getTodayDate+'&limit=' + limit,"block","i_opinions_"+qar);	
}


function suggestItems2(qar, limit){
	var row=5;
	limit=5;
	var getTodayDate=new Date();
		//curr_open=0;
		currect_qar=qar;
		document.getElementById("i_recom_bk").innerHTML="";
		getInfo(urlSuggest + '?w=' + qar + '&row=' + row + '&colm=4&rand='+getTodayDate+'&limit=' + limit,"block","i_recom_bk");	
}

var urlMicro = global_url+"/ajax/micro.asp";
function microItemsAdding(limit, content, mainId){
	var getTodayDate=new Date();
		//curr_open=0;
		getInfo(urlMicro + '?content='+content+'&mainId='+mainId+'&rand='+getTodayDate+'&limit=' + limit,"block","i_microit");	
}


	
	
var urlSetTv = global_url+"/ajax/settv.asp";
function setUserTv(tvCompany){
	var getTodayDate=new Date();
		//curr_open=0;
		document.getElementById("i_set").innerHTML="";
		getInfo(urlSetTv + '?set=' + tvCompany,"block","i_set");
}


function OpenOptions(i_id) {
          var objStyle = document.getElementById(i_id).style
	objStyle.display=objStyle.display == "none" ? "block" : "none"
}

			var xmlHttp
			var GlobalNowResponse = 0;

			function getInfo(url,type,name,w)
			{
				xmlHttp=GetXmlHttpObject()

				if (xmlHttp==null){
					alert ("Browser does not support HTTP Request")
					return
				} 
	
				xmlHttp.onreadystatechange = function(){updateInfo(type,name,w);}
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null);
			} 

			function updateInfo(type,name,w){
				//alert("updateInfo"+w);
				if (xmlHttp.readyState==4){
//alert("readyState"+w);
					if (xmlHttp.status==200){
						//alert("status"+w);
						//alert("there");
						if (type == "block"){
							document.getElementById(name).innerHTML = "<span style='font-size: 13px;font-weight: bold;'>Loading</span>";
							
							if(w=="movies"){
								//alert("movies");
								document.getElementById("i_opinions_movies").innerHTML = unescape(xmlHttp.responseText);
							}else {
								if(w=="books"){
									//	alert("books");
										document.getElementById("i_opinions_books").innerHTML = unescape(xmlHttp.responseText);
								}else{
								if(w=="series"){
										document.getElementById("i_opinions_series").innerHTML = unescape(xmlHttp.responseText);
								}else{
								if(w=="music"){
										document.getElementById("i_opinions_musics").innerHTML = unescape(xmlHttp.responseText);
								}else{
									document.getElementById(name).innerHTML = unescape(xmlHttp.responseText);
								}
								}
								}
							}
							return (null);
						} else if (type == "global"){
							name = unescape(xmlHttp.responseText);
						} else if (type == "variable"){
							
						} else {
							return (null);
						}
					}
				}
			} 

	
		function GetXmlHttpObject()
			{ 
				var objXMLHttp=null
				if (window.XMLHttpRequest) {
					objXMLHttp=new XMLHttpRequest()
				} else if (window.ActiveXObject) {
					objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
				}
				return objXMLHttp
			}
			

	function gl_commentUnMarkAll(itemId, id){
				// reset stars
		for (i=1;i<=5;i++){
			document.getElementById(id.substring(0,id.length-1) + i).src = global_url+"/results/includes/_overstar.gif";
		}	
				// make stars
				var cuRate=document.getElementById(itemId).rates.value;
				if(cuRate=='') cuRate=0;
		for (i=1;i<=cuRate;i++){
			document.getElementById(id.substring(0,id.length-1) + i).src = global_url+"/results/includes/_star.gif";
		}
	}


	function gl_markStars(id){
		for (i=1;i<=5;i++){
			document.getElementById(id.substring(0,id.length-1) + i).src = global_url+"/results/includes/_overstar.gif";
		}
		
		var basicId = id.substring(0,id.length-1);
		for (i=1;i<=id.substring(id.length-1,id.length);i++){
			document.getElementById(basicId + i).src = global_url+"/results/includes/_star.gif";
		}
	}

	function gl_rateValue(itemId, id){
	document.getElementById(itemId).rates.value=id;
	}

	function nuconomy_wid(i){
		var contentId=131;
		if(i=="movies") contentId=131;
		if(i=="books") contentId=132;
		if(i=="music") contentId=133;
		if(i=="rest") contentId=134;
		
		return contentId;
	}
	
		function searchByQuery(wid, query){
			var getWid=nuconomy_wid(wid);
			
			NUCONOMY.ContentType=getWid;
			NUCONOMY.ContentTitle = "Search By Query: "+query;
			NUCONOMY.Logger.LogActivity(userName,"","",925);
		}
		
		function searchByCategory(wid){
			var getWid=nuconomy_wid(wid);
			
			NUCONOMY.ContentType=getWid;
			NUCONOMY.ContentTitle = "Search By Category";
			NUCONOMY.Logger.LogActivity(userName,"","",926);
		}

		function homepageTabs(wid, tabId){
			var getWid=nuconomy_wid(wid);
			var activitieId=0;
			
			if(tabId==1) activitieId=928;
			if(tabId==2) activitieId=929;
			if(tabId==3) activitieId=930;
			if(tabId==5) activitieId=931;
			if(tabId==6) activitieId=932;
			
			NUCONOMY.ContentType=getWid;
			NUCONOMY.ContentTitle = "Click On HomePage Tab";
			NUCONOMY.Logger.LogActivity(userName,"","",tabId);
		}

		function gotoSuggest(){
			this.location=global_url+"/suggest/?history=1&sq="+document.getElementById("query").value;
		}
	
		function showSubMenu(id){
				//document.getElementById("i_"+id).style.display = "block";	
				//document.getElementById("i_item_"+id).className = "itemLnk1";
				//document.getElementById("i_td_"+id).className = "itemOn";
				
			}
	
			function hideSubMenu(id){
				/*document.getElementById("i_"+id).style.display = "none";	
				document.getElementById("i_item_"+id).className = "itemLnk";
				document.getElementById("i_td_"+id).className = "item";
		*/	}
					
		function doOnLoad(){
			//document.getElementById('i_recom_movies').style.display='block';
			//document.getElementById('i_recom_books').style.display='none';
			//document.getElementById('i_recom_music').style.display='none';
			//document.getElementById('i_recom_rests').style.display='none';
			//document.getElementById('mainTab_1').className='gmain_tabMark';
			//document.getElementById('mainTab_3').className='gmain_tab';
			//document.getElementById('mainTab_4').className='gmain_tab';	
		//	suggestItems('movies', 5);
			//opinionsItems('movies');
			//opinionsItems('books');
			//opinionsItems('series');
			//opinionsItems('music');
			//microItems(10);
			
			//showSubMenu('movies');
			//hideSubMenu('books');
			//hideSubMenu('music');
			//hideSubMenu('rests');
			//hideSubMenu('blogs');
		}
		
		onload = function(){
		//	doOnLoad();
		}
