function WallaOpenWin(url,nname,features,rreplace)
{
	var W_win;
	W_win=window.open(url,nname,features,rreplace);
	if(W_win==null)	
	{
		// handle the URL
		while(url.indexOf('?')>(-1))
		url=url.substring(0,url.indexOf('?')) +"^"+ url.substring(url.indexOf('?')+1, url.length);
	
		while(url.indexOf('&')>(-1))
			url=url.substring(0,url.indexOf('&')) +"$"+ url.substring(url.indexOf('&')+1, url.length);
	
		while(url.indexOf('=')>(-1))
			url=url.substring(0,url.indexOf('=')) +"*"+ url.substring(url.indexOf('=')+1, url.length);
	
		// handle the features
		while(features.indexOf('=')>(-1))
			features=features.substring(0,features.indexOf('=')) +"*"+ features.substring(features.indexOf('=')+1, features.length);
		help_url="http://help.walla.co.il/ts.cgi?tsscript=open_win&url="+url+"&name="+nname+"&features="+features+"&replace="+rreplace;
		location.replace(help_url);
	}	
	else 
	{
		//history.back();
		location.href="http://www.walla.co.il";
	}
}
function WallaPlayer(mode,id,vote,site,type)
{
	if(type == "radio")
	{
		params=new String();
		found_checked=0;
		if(mode==0)
		{
            if(site == "noar")
				params = "mode=20^id=";
			else
				params = "mode=0^id=";
			playlist_id = "";
			for(i=0;i<document.ready_channels.elements.length;i++)
				if(document.ready_channels.elements[i].checked)
				{
					name = new String();
					name = document.ready_channels.elements[i].name;
					name = name.substring(name.indexOf("_")+1, name.length);
					params = params + name +".";
					playlist_id = playlist_id + name + ".";
					found_checked = 1;
				}
			document.cookie = "channel_id="+playlist_id;
			if(found_checked==0)
				params = params + "37.";
		}	
		else 
		{
			params = "mode="+mode+"^id="+id;
		}
		params = "["+params+"]";
		window.open("http://wow2.walla.co.il/ts.cgi?tsscript=player/link_manager&player_mode=2&site="+site+"&url="+params,"wplayer","height=485,width=500,toolbar=0,location=0,resizable=0,scrollbars=0");
	}
	else
	{
		if(vote == null) vote ="1";
		if(site == null) site ="walla";			
		the_url = "http://wow2.walla.co.il/ts.cgi?tsscript=player/link_manager&mode="+mode+"&id="+id+"&vote="+vote+"&site="+site;
		window.open(the_url ,"wplayer","height=485,width=500,toolbar=0,location=0,resizable=1,scrollbars=0");
	}
}
function WallaVideo(id,skin)
{
	var url; url = "http://player.walla.co.il/?w=//"+id+"/"+skin+"/@video";
	window.open(url ,"WallaPlayer","top=80,left=80,height=520,width=610,toolbar=0,location=0,resizable=1,scrollbars=0");
}
function WinOp(PageToLoad,Names,w,h,s)
{
	window.open(PageToLoad,Names,"width="+w+",height="+h+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
}
