	<!-- hide me from non-JavaScript-enabled browsers
		window.name="parentWin";
		// open new window

		function openwin(windowName,width,height,target)
		{
			if (target == "")
				target = "";

			newWindow = window.open(windowName, target,'toolbar=no,menubar=no,width='+width+',height='+height+',scrollbars=yes,resizable=no');
		}

		function openleague(windowName,target)
		{
			if (target == "")
				target = "_league";

			newWindow = window.open(windowName, target,'toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function profile(p)
		{
			tar = "_prof";
			url = "profiles.php?a=w&t=p&pid=" + p;
			newWindow = window.open(url, tar,'width=420,height=400,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function mdemo()
		{
			newWindow = window.open('mobiledemo.php', 'mdemo','width=270,height=540,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function pp(p)
		{
			tar = "_pp";
			//url = "profiles.php?a=w&t=ppov&pid=" + p + "&year=" + document.rform.year[document.rform.year.selectedIndex].text+ "&period=" + document.rform.period[document.rform.period.selectedIndex].text;
			url = "profiles.php?a=w&t=ppov&pid=" + p;
			newWindow = window.open(url, tar,'width=900,height=670,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function bkmua(m)
		{
			tar = "_bkb";
			url = "admin.php?admin=pop&task=bkbmua&mid=" + m;
			newWindow = window.open(url, tar,'width=450,height=500,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function bkmud(m)
		{
			if (confirm("Delete Basketball Match ("+m+")?"))
			{
				if (confirm("Delete Basketball Match ("+m+")?"))
				{
					tar = "_bkbd";
					url = "admin.php?admin=pop&task=bkbmud&mid=" + m;
					newWindow = window.open(url, tar,'width=400,height=200,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
				}
			}
		}

		function sc(m)
		{
			tar = "_sc";
			url = "admin.php?admin=pop&task=sc&mid=" + m;
			newWindow = window.open(url, tar,'width=450,height=500,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}
		
		function isc(m)
		{
			tar = "_sc";
			url = "admin.php?admin=pop&task=isc&mid=" + m;
			newWindow = window.open(url, tar,'width=550,height=500,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function ph(p)
		{
			tar = "_prof";
			url = "profiles.php?a=w&t=ph&hist&pid=" + p;
			newWindow = window.open(url, tar,'width=650,height=410,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function spu()
		{
			tar = "_spu";
			url = "profiles.php?a=w&t=spu";
			newWindow = window.open(url, tar,'width=330,height=250,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function spn()
		{
			tar = "_spn";
			url = "profiles.php?a=w&t=spn";
			newWindow = window.open(url, tar,'width=330,height=250,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function tm(m,t)
		{
			//tar = "_team";
			//url = "teams.php?a=p&t=det&mid=" + m + "&tid=" + t;
			//newWindow = window.open(url, tar,'width=580,height=500,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function L(t, m)
		{
			tar = "_league";
			if (t == 1) url = "tables.php?a=p&t=6m&mid=" + m;
			else if (t == 3) url = "basketball.php?a=p&t=lt&mid=" + m;
			newWindow = window.open(url, tar,'width=780,height=670,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function M(t,m)
		{
			tar = "_mat";
			if (t == 1) url = "matches.php?a=p&t=det&mid=" + m ;
			else if (t == 2) url = "int.php?a=m&mid=" + m;
			else if (t == 3) url = "basketball.php?a=p&t=det&mid=" + m ;
			//alert(url);
			newWindow = window.open(url, tar,'width=768,height=570,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function B(m,t)
		{
			tar = "_FB";
			url = "fantasy.php?a=c&mid=" + m +"&t=" + t ;
			newWindow = window.open(url, tar,'width=700,height=550,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function Z(b,m)
		{
			if (b == 100)
			{
				O(1,m);
				return;
			}
			tar = b;
			url = "bkodds.php?b=" + b +"&m=" + m ;
			newWindow = window.open(url, tar,'');
		}

		function PFB(t,b,m)
		{
			tar = "_FB";
			url = "fantasy.php?a=pfb&mid=" + m + "&bt=" + b + "&mt=" + t ;
			newWindow = window.open(url, tar,'width=500,height=500,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function C(t,m)
		{
			tar = "_mat";
			if (t == 1) url = url = "matches.php?a=p&t=cdet&mid=" + m ;
			else if (t == 3) url = "basketball.php?a=p&t=cdet&mid=" + m ;
			newWindow = window.open(url, tar,'width=740,height=570,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function MD(m,t)
		{
			tar = "_int";
			url = "int.php?a=m&mid=" + m + "&t=" + t;
			newWindow = window.open(url, tar,'width=740,height=570,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function O(s,m)
		{
			tar = "_odds";
			if ( s == 1) url = "matches.php?a=p&t=o&mid=" + m ;
			else if (s == 2 ) url = "int.php?a=o&mid=" + m ;
			else if ( s == 3) url = "basketball.php?a=p&t=o&mid=" + m ;
			//alert (url);
			newWindow = window.open(url, tar,'width=740,height=570,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function P(s,m)
		{
			tar = "_preview";
			url = "mp.php?a=p&sp=" + s + "&mid=" + m ;
			newWindow = window.open(url, tar,'width=760,height=570,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
		}

		function E(s,m)
		{
			tar = "_preview";
			if ( s == 1) url = "myevent.php?a=mye1&sp=1&mid=" + m ;
			else if ( s == 2) url = "myevent.php?a=mye1&sp=2&mid=" + m ;
			else if ( s == 3) return;
			newWindow = window.open(url, tar,'width=560,height=480,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
		}

		function OD(m)
		{
			tar = "_odds";
			url = "int.php?a=o&mid=" + m ;
			newWindow = window.open(url, tar,'width=740,height=570,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
		}

		function openpop(index)
		{
			if ( index == 1)
	   	    	openwin('tour.php?a=t&t=1',650,550,"_tour");
	   	    else if ( index == 2)
	   	    	openwin('user.php?a=r',450,510,"_refer");
	   	    else if ( index == 3)
	   	    	openwin('help.php?p=t&t=1',650,550,"_tutorial");
   	   	    else if ( index == 4)
   	   	        window.open('user.php?a=reg', '_register','toolbar=no,menubar=no,status=yes,width=550,height=650,scrollbars=yes,resizable=no');
//   	   	        window.open('https://securehost34.hrwebservices.net/~betdevi/user.php?a=reg', '_register','toolbar=no,menubar=no,status=yes,width=550,height=650,scrollbars=yes,resizable=yes');
	   	    else if ( index == 5)
	   	    	openwin('help.php?p=t&t=21',650,550,"_tutorial");
	   	    else if ( index == 6)
	   	    	openwin('help.php?p=t&t=13',650,550,"_tutorial");
	   	    else if ( index == 7)
	   	    	openwin('help.php?p=t&t=2',650,550,"_tutorial");
	   	    else if ( index == 8)
	   	    	openwin('help.php?p=t&t=27',650,550,"_tutorial");
	   	    else if ( index == 9)
	   	    	openwin('profiles.php?a=w',450,500);
			else if ( index == 10)
	   	    	openwin('user.php?a=sms',550,550);
		}

		function popl(index)
		{
			if ( index == 'enP')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/eng_prem/default.stm', index);
	   	    else if ( index == 'enC')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/eng_div_1/default.stm', index);
	   	    else if ( index == 'en1')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/eng_div_2/default.stm', index);
	   	    else if ( index == 'en2')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/eng_div_3/default.stm', index);
	   	    else if ( index == 'enCo')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/eng_conf/default.stm', index);
	   	    else if ( index == 'scP')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/scot_prem/default.stm', index);
	   	    else if ( index == 'sc1')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/scot_div_1/default.stm', index);
	   	    else if ( index == 'sc2')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/scot_div_1/default.stm', index);
	   	    else if ( index == 'sc3')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/scot_div_1/default.stm', index);
	   	    else if ( index == 'sc4')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/scot_div_1/default.stm', index);
	   	    else if ( index == 'ireP' || index == 'ir1')
	   	    	openleague('http://www.rte.ie/aertel/p220.htm', 'ire');
	   	    else if ( index == 'itA' || index == 'itB')
	   	    	openleague('http://www.channel4.com/sport/football_italia/index.html', 'it');
	   	    else if ( index == 'sin')
	   	    	openleague('http://www.sleague.com', index);
	   	    else if ( index == 'sp1' || index == 'sp2')
	   	    	openleague('http://www.soccer-spain.com', 'sp');
	   	    else if ( index == 'ger1' || index == 'ger2' || index == 'gerN' || index == 'gerS')
	   	    	openleague('http://www.sportinglife.com/football/overseas/germany/news/', 'ger');
	   	    else if ( index == 'enRy')
	   	    	openleague('http://www.isthmian.co.uk/', index);
	   	    else if ( index == 'enSL')
	   	    	openleague('http://www.southern-football-league.co.uk', index);
	   	    else if ( index == 'enUn')
	   	    	openleague('http://www.unibondleague.com', index);
	   	    else if ( index == 'enCN')
	   	    	openleague('http://news.bbc.co.uk/sport1/hi/football/eng_conf/default.stm', index);
		}


/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 *
 * @return  boolean  whether pointer is set or not
 */
function F(theRow)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined')
    {
        return false;
    }

    var row_cells_cnt           = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++)
    {
        theRow.cells[c].bgColor = '#d0d0d0';
    }

    return true;
} // end of the 'setPointer()' function

function U(theRow)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined')
    {
        return false;
    }

    var row_cells_cnt           = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++)
    {
        theRow.cells[c].bgColor = '#ffffdd';
    }

    return true;
} // end of the 'setPointer()' function

function u(theRow)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined')
    {
        return false;
    }

    var row_cells_cnt           = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++)
    {
        theRow.cells[c].bgColor = '#ffffff';
    }

    return true;
} // end of the 'setPointer()' function

function gotoURL(oDropdown)
{
	var intSelected = oDropdown.selectedIndex;
	var strTarget = oDropdown.options[intSelected].value;

    if(strTarget != "")
    {
        window.location = strTarget;
    }
}


// Simple Browser Check
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;

// Browser Window Dimensions
function winWid(){ return (ns4||ns6) ? window.innerWidth : document.body.clientWidth; }
function winWid1(){ return (ns4||ns6) ? window.Width : document.body.Width; }
function winHei(){ return (ns4||ns6) ? window.innerHeight : document.body.clientHeight; }



function updownshadow()
{
	if (event.srcElement.className=="popshadow")
	{
		tempobject=event.srcElement

		if (event.type=="mousedown")
		{
			tempobject.filters[0].enabled=false
			tempobject.style.left=tempobject.style.top=0
		}
		else
		{
			tempobject.filters[0].enabled=true
			tempobject.style.left=tempobject.style.top=-5
		}
	}
}


if (document.all)
{
	document.body.onmousedown=updownshadow
	document.body.onmouseup=updownshadow
}


// Simple Browser Check
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;

// Browser Window Dimensions
function winWid(){ return (ns4||ns6) ? window.innerWidth : document.body.clientWidth; }
function winWid1(){ return (ns4||ns6) ? window.Width : document.body.Width; }
function winHei(){ return (ns4||ns6) ? window.innerHeight : document.body.clientHeight; }

function Lad(s1,s2,s3)
{
	if ( s1 == "" || s2 == "" || s3 == "" )return; 	target = '_lad';
	url = 'http://service.bfast.com/bfast/click?bfmid=37927609&siteid=41256071&bfpage=text_link';
    newWindow = window.open(url, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function SB(s1,s2)
{
	if ( s1 == "" || s2 == "" )return; 	target = '_SportingBet';
	url = 'http://www.sportingbet.com/cgi-bin/bet_slip.cgi?action=add&line=' + s1 + ',2&affiliate=betdevil'
	url = 'http://www.sportingodds.com/index.asp?tpid=21337';
	newWindow = window.open(url, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function BS(s1,s2,s3)
{
	if ( s1 == "" || s2 == "" || s3 == "" )return; target = '_BSq';
	url = 'http://www.bluesq.com/bsq_rp?action=go_standalone&popup=1&ev_oc_id=' + s1 + '&lp_num=' + s2 + '&lp_den=' + s3 + '&AFF_ID=525';
    openwin(url,420,600,target);
}

function EU(s1)
{
	if (s1 == "")return; target = '_eu';
	url = 'http://www2.eurobet.com/online/go_log.BannerTrack?p_origin=719';
	url = 'http://www.eurobet.com/sb.go?page=bannertrack&origin=109075';
	ur = 'http://www2.coral.co.uk/online/go_log.BannerTrack?p_origin=719&p_ref=http://www2.coral.co.uk/online/go_slip.AddToBs?p_oddslist=' + s1 + '|p_oddslist=d';
	//alert(ur);
    newWindow = window.open(url, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function B3(s1,s2)
{
	if (s1 == "")return; target = '_365';
	ur = 'http://www.bet365.com/home/default.asp?participantid=' + s1 + '&affiliatecode=grm_1558&odds=' + s2 + '&instantbet=1'
    newWindow = window.open(ur, target,'toolbar=no,menubar=no,width=600,height=550,scrollbars=yes,resizable=yes');
}

function B6()
{
	target = '_365';
	ur = 'http://www.bet365.com/home/default.asp?affiliate=grm_1558';
    newWindow = window.open(ur, target,'');
}

function GB()
{
	target = '_gb';
	ur = 'http://www.gamebookers.com/cgi-bin/intro.cgi?wm=2847442'
    newWindow = window.open(ur, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function PB()
{
	target = '_pb';
	ur = 'http://www.parbet.com/affiliate/bannerclick.jsp?aid=174138&bid=0'
    newWindow = window.open(ur, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function BF(code)
{
	target = '_bf';
	ur = 'http://global.betfair.com/?rfr=833&mi=' + code;
    newWindow = window.open(ur, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}


function BQ(code)
{
	target = '_bq';
	ur = 'http://www.betdaq.co.uk/UI?mktid='+code;
	ur = 'http://clkuk.tradedoubler.com/click?p=11554&a=862782&g=1057370';
    newWindow = window.open(ur, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function PS()
{
	target = '_ps';
	//ur = 'http://www.betdaq.com/betdaq?go='+code;
	ur = 'http://www.pinnaclesports.com/default.asp?language=British&LExt=bri&refer=xbetdevil';
    newWindow = window.open(ur, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function VC()
{
	target = '_vc';
	ur = 'http://www.victorchandler.com/shell_homepage.jsp?OID=2547';
    newWindow = window.open(ur, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}


function PP(x)
{
	target = '_PP';
	ur = 'http://www.paddypower.com/bet?action=cmp&cid=42&AFF_ID=92375';
    newWindow = window.open(ur, target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function CTP(mid)
{
	target = '_ctp';
	ur = 'partners.php?a=p&t=c&m=' + mid;
    newWindow = window.open(ur, target,'toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=520,height=470');
}


function OD(iBK,iE)
{
	target = iBK;
	if (iBK == 0)
	{
		O(3,iE);
	}
	else
	{
		url = "bookmaker.php?bk=" + iBK + "&eid="+ iE;
		window.open(url , target,'toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
	}
	return false;
}

function mypref() 
{
	window.open("user.php?a=mpref", "_mpref",'width=370,height=290,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
}

///////////////////////
// News & Search
//var strBaseUrl = "http://localhost/betdevilci/";
var gsU;
var giU;

function InitNewsList(u,su) 
{ 
    giU = u;     
    gsU = su;
    
    //alert (giU);
}

function gN(i,p,ip,s) 
{ 
    //alert (giU+"|"+i+"|"+p+"|"+ip+"|"+s);
    if (i==1 && p==1 && ip==10)
    {
        if (giU < 3 && s != "") 
        { 
            return;
        }
    }
    else
    {
        if (giU<3) 
        { 
            alert("Silver/Gold Member Service."); 
            return;
        }
    }

    //alert(s);
    s = s.replace(/\"/g, "");
    s = s.replace(/\'/g, "");
    s = s.replace(/"/g, "");
    s = s.replace(/'/g, "");    
    //alert(s);
    strURL = gsU +"newsmenu.php?i="+i+"&p="+p+"&ip="+ip+"&s="+s;
    var http = false;

    if(navigator.appName == "Microsoft Internet Explorer") 
    {
        http = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else 
    {
        http = new XMLHttpRequest();
    } 

    //alert (strURL);
    http.open("GET", strURL, true);
    http.onreadystatechange=function() 
    {
        if(http.readyState == 4) 
        {
            //alert (http.responseText);
            if (http.responseText.length > 0)
                document.getElementById('NewsList').innerHTML = http.responseText;
        }
    }
    http.send(null);    
}

function getNonS() 
{ 
    if ( giU < 3) {alert("Silver/Gold Member Service."); return;}
    var i = 1;
    var p = 1;
    //var s = $("input#NewsSearch").val();
    var s = document.getElementById('NewsSearch').value;
    gN(i,p,10,s);  
}

// done hiding -->


