﻿// JavaScript Document
var CurrCat = "news";
//document.getElementById("search").target = "_blank";


function OpenLink(target)
{
	if (document.getElementById("search").newWindow.checked)
		window.open(target);
	else
		window.location=target;
}

function ChangeTarget()
{
//	alert(document.getElementById("search").target);
	if (document.getElementById("search").target == "_self")
		document.getElementById("search").target = "_blank";
	else
		document.getElementById("search").target = "_self";
}

function ChangeCat(newCat) 
{
	if(navigator.userAgent.indexOf("Firefox")!=-1) 
	{
	document.getElementById(CurrCat).style.background = "";
	document.getElementById(CurrCat+"t").style.background = "url('images/bg_tab.gif')";
	document.getElementById(newCat).style.background = "url('images/bg_tab1.gif')";
	document.getElementById(newCat+"t").style.background = "url('')";
	document.getElementById('din_frame').src = "enter_rss_" + newCat + ".php";
	CurrCat = newCat;
	}
	else 
	{
	document.getElementById(CurrCat).background = "";
	document.getElementById(CurrCat+"t").background = "images/bg_tab.gif"
	document.getElementById(newCat).background = "images/bg_tab1.gif"
	document.getElementById(newCat+"t").background = ""
	document.getElementById('din_frame').src = "enter_rss_" + newCat + ".php";
	CurrCat = newCat;
	}
}

//	function to set as home page
function setHomePage(obj)
{
	var isIE = document.all ? true:false;
	var isNS6 = (document.getElementById && !isIE) ? true:false;
	var isOther = (!isIE && !isNS6);
	var link = document.getElementById('setas');
	var stylesh = '<style type=text/css>'
		+'BODY{	background: #ffffff;'
		+'FONT-FAMILY: Arial, Helvetica, Geneva, sans-serif;'
		+'FONT-SIZE: 12px;'
		+'color: #oooooo;}'
		+'A:link, A:visited, A:active {color:#0000ff;}'
		+'.purplebuttontext{'
		+'COLOR: #000000;'
		+'FONT-WEIGHT: bold;'
		+'FONT-SIZE: 12px;'
		+'LINE-HEIGHT: 12px;'
		+'FONT-FAMILY: Arial, Helvetica, Geneva, sans-serif;'
		+'TEXT-DECORATION: none}'
		+'a.purplebutton{'
		+'padding: 1px 6px 1px 6px;'
		+'border: 2px outset #cccccc;'
		+'background: #eeeeee;'
		+'COLOR: #000000;'
		+'text-decoration: none;'
		+'height: 19px;'
		+'vertical-align: middle;'
		+'}'
		+'a.purplebutton:focus, a.purplebutton:hover{'
		+'border: 2px inset #cccccc;'
		+'vertical-align: middle;'
		+'background: #eeeeee; '
		+'color: #000000;'
		+'text-decoration: none;}'
		+'</style>';
	
		var closewin = '<table width="100%"><tr><td class="purplebuttontext" align="left"><a href="#" class="purplebutton" onClick="window.close();">Close window</a></td></tr></table>';
		if(isIE)
		{
			eval("link.style.behavior=\'url(#default#homepage)\';");
			eval("link.setHomePage(\'http://www.enter.co.il');");
		}
		// If its Netscape 6, tell user to drag link onto Home button
		else if(isNS6) 
		{
			var win = window.open('','HomePage','width=180,height=80')
			win.document.write(stylesh+'ע"מ להפוך עמוד זה לעמוד הבית<br>' + '<A ondrag="window.close();" HREF="http://www.enter.co.il">Enter.co.il</a> שלך גרור את הלינק <br>' + 'לכפתור של עמוד הבית בדפדפן'  +closewin);

		}
		else 
		{
			var win = window.open('','HomePage','width=180,height=80');
			win.document.write(stylesh+'<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.<p>'+closewin);
		}
}

var urlAddress = "http://www.enter.co.il/";
var pageName = "Enter.co.il";
function addToFavorites() 
{
	if ( window.sidebar) 
	{ // Mozilla Firefox Bookmark
		window.sidebar.addPanel (pageName, urlAddress,"");
    } 
	else if( window.external ) 
	{ // IE Favorite
		window.external.AddFavorite(urlAddress, pageName);
    } 
	else 
	{
		alert("Sorry! Your browser doesn't support this function.");
    }         
}


