


	function RedirTag(TagID, SiteCount)
	{
		if (SiteCount>1)
		{
		
		window.location = "SiteList.asp?TagID="+TagID
		}
		else
		{
		
		window.open("Tagredir.asp?TagID="+TagID)
		}
	}

	function UpdateTag(Tid)
	{
	//alert(Tid)
	HostPath = window.location.hostname
	frames['UpTagFrm'].location.href='http://'+HostPath+'/TagUpdate.asp?TagID='+Tid;
	}
	

	var UnqSiteIDClicked
	function SetSiteClick(Sid,IsUnq)
	{
	//alert(Tid)
	HostPath = window.location.hostname
	if (IsUnq == 1)
		{
		if (UnqSiteIDClicked != Sid)// one click possible at each page reload per user
			{
			frames['UpTagFrm'].location.href='http://'+HostPath+'/UnqSiteClicks_inc.asp?SiteID='+Sid
			}
		UnqSiteIDClicked = Sid
		}
	else
		{
		frames['UpTagFrm'].location.href='http://'+HostPath+'/SiteClicks_inc.asp?SiteID='+Sid
		//alert(IsUnq)
		}	
	}	
	
	
	

////////////////////////////////////////////


	var IsLogin = ""
	function getCookie(c_name)
	{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=")
	  if (c_start!=-1)
	    { 
	    c_start=c_start + c_name.length+1 
	    c_end=document.cookie.indexOf(";",c_start)
	    if (c_end==-1) c_end=document.cookie.length
	    return IsLogin = 1;
	    } 
	  }
	return;
	}

	var getLogged = 0
	function SetFav(FavID,TagCount, NumOfTags,CatCount)
	{

	getCookie("IsLogin")
	if (IsLogin==1)
	{
		StarSrc =  document["star"+FavID+"_"+TagCount].src
		HostPath = window.location.hostname	
		frames['UpTagFrm'].location.href ="/SetFav.asp?FavID="+FavID
		
			if (StarSrc == "http://"+HostPath+"/Images/star_.gif")
			{
				for (StarCount=0; StarCount < NumOfTags; StarCount++)
				{
					if(document["star"+FavID+"_"+StarCount])
					{
					document["star"+FavID+"_"+StarCount].src = "/Images/star_on.gif"
					}
				}
			}
			else
			{
				for (StarCount=0; StarCount < NumOfTags; StarCount++)
				{
					if(document["star"+FavID+"_"+StarCount])
					{
					document["star"+FavID+"_"+StarCount].src = "/Images/star_.gif"
					}
				}
			}
		}else{	
	
		if (getLogged == 0)
			{
			document.getElementById("LoginAlert"+CatCount).style.display  = "block";
			}
		}
	}
	
	function CloseAlertDIV(CatCount)
	{
		document.getElementById("LoginAlert"+CatCount).style.display  = "none";
		//document.getElementById("AlertDIV").style.top  = 0+"px";
		getLogged = 0;
	}
	
//////////////////////////////////////
	startList = function(TagID) 
	{

		document.getElementById("TagName"+TagID).onmouseover=function() 
				{
				document.getElementById("TagSiteHint"+TagID).style.display= 'block';
				};
		document.getElementById("TagName"+TagID).onmouseout=function() 
				{
				document.getElementById("TagSiteHint"+TagID).style.display= 'none';
				};				
	}

///////////////////////////////////////
//////////////////////////////////////
	startMsg = function(TrigerName,DivName,DivID) 
	{

		document.getElementById(TrigerName).onmouseover=function() 
				{
				document.getElementById(DivName+DivID).style.display= 'block';
				};
		document.getElementById(TrigerName).onmouseout=function() 
				{
				document.getElementById(DivName+DivID).style.display= 'none';
				};				
	}

///////////////////////////////////////

function bookmark()
{
	
    var Favtitle="Findex- אינדקס אתרים מבוסס תגיות"
    var Favurl="http://www.findex.co.il"

    if (window.sidebar) 
    { 
        window.sidebar.addPanel(Favtitle, Favurl,"");
       // alert("Firefox users: This link will open in your Sidebar\nrather than the main page!\nTo prevent this please right click the link and choose\n'Properties' and then uncheck the box marked:\n'Load This Bookmark in the Sidebar'\n\nSorry about this, but it is unavoidable with Firefox");
 		 alert("משתמשי פיירפוקס: יש להוסיף קישור זה ל\n Bookmarks Toolbar \n על מנת להוסיפו לתפריט הלינקים העליון'");
    } else if( window.opera && window.print ) 
    { 
   		//alert("Opera users: By Default this link will open in your Sidebar\nrather than the main page!\nTo prevent this please uncheck the box marked\n'Show in Panel' that appears on the Add Bookmark window\n\nSorry about this, but it is currently unavoidable with Opera");
		alert("משתמשי אופרה: לינק זה יפתח בסרגל הצד ולא בחלון הראשי \n על מנת למנוע זאת  עליכם להוריד את הסימון מ\n 'Show in Panel'");
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',Favurl);
    mbm.setAttribute('Favtitle',Favtitle);
    mbm.click();
    } else if( document.all ) 
    { 
    window.external.AddFavorite( Favurl, Favtitle); 
    } 

}
////////////////////////////////////////////////////

function createCookie(name,value,days) 
{
	if (days) 
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	
	if (name == 'SetOPage')
	{
		alert("דף זה נבחר כמסך הפתיחה שלך")
		location.reload(true);
	}
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

