function cricketpagerefresh() {
	var ae= p_o("adframe1");
	ae.src=ae.src;
	var ae= p_o("adframe2");
	ae.src=ae.src;
	var s_code=s_265.t();
}

function hiLiteRow(senderObj, newClass) {
    senderObj.className = newClass;		
}

function activateTab(id, mod, no_tabs) {
    for (var i=1; i<=no_tabs; i++) {
        if  (p_o(mod+"_tc"+i)) {
            if (id == i) {
                p_o(mod+"_tc"+i).style.display = "block";
                p_o(mod+"_t"+i).className= "active";
            } else {
                p_o(mod+"_tc"+i).style.display = "none";
                p_o(mod+"_t"+i).className = "";
            }
        }
    }
}

var toFcs=null;
function p_o(o){return document.getElementById(o);}
function showTab(did,cid,cback){
    if(did==null)return false;
    var div=p_o(did);
    var tab=p_o(cid);
    if(tab==null)return false;
    var tabs=div.childNodes;
    for(var i=0;i<tabs.length;i++){
        if(tabs[i].nodeType==1&&tabs[i]!=tab){
            tabs[i].className='dn';
        }
    }
    tab.className='di';
    if(cback!=null)eval(cback);
    fcs();
}
function mkTab(did,cid,htm){
    var div=p_o(did);
    if(div==null)return;
    var newT=false;
    var tab=p_o(cid);
    if(!tab){
        tab=document.createElement('div');
        tab.setAttribute('id',cid);
        newT=true;
    }
    tab.className='dn';
    tab.innerHTML=htm;
    if(newT)div.appendChild(tab);
}
function allLI(arg) {
    if (p_o(arg)) {
        if (tablisttag==null)tablisttag='li';
        var x = p_o((arg)).getElementsByTagName(tablisttag).length;
        while (x>0) {
            if (p_o((arg+x)))p_o((arg+x)).className="";
            if (p_o((arg+'a'+x)))p_o((arg+'a'+x)).className="";
            x--;
        }
    }
}
function selTab(arg,i){
    if(arg!=null){
        allLI(arg);
        lidx = (arg +i);
        liadx = (arg+'a'+i);
    }
    if(arg == 'r'){
        p_o(lidx).className="curr";
    }else if(arg!=null){
        if (p_o(lidx))p_o(lidx).className="over";
        if (p_o(liadx)){
            if(dlscheme[i]){
                p_o(liadx).className="sel "+ dlscheme[i];
            }else{
                p_o(liadx).className="sel";
            }
        }
    }
}
function pGet(url,i,arg,id,cback,frce,fcsId){
    var cid=id+i;
    toFcs=fcsId;
    if((frce!=null&&frce)||showTab(id,cid,cback)==false){
        var uid=(new Date()).getTime();
        url+='&uid='+uid+'&cid='+cid;
        if(arg!=null)url+='&targ='+arg;
        if(i!=null)url+='&tid='+i;
        if(cback!=null)url+='&cback='+escape(cback);
    }else{
        selTab(arg,i);
    }
}
function fcs(id){
    if(id==null){
        if(toFcs==null)return;
        id=toFcs;
    }
    var o=p_o(id);
    toFcs=null;
    if(!o)return;
    if(o.getAttribute("tabIndex")==null){
        switch(o.nodeName.toLowerCase()){
            case 'a':
            case 'body':
            case 'button':
            case 'frame':
            case 'iframe':
            case 'img':
            case 'input':
            case 'object':
            case 'select':
            case 'textarea':
                break;
            default:
                o.setAttribute("tabIndex","-1");
                break;
        }
    }
    if(o.focus){
        if(document.all){
            o.focus();
            o.focus(); 
        }else{
            setTimeout('p_o("' + o.id + '").focus()', 0);
        }
    }
}
function ae(o,et,fn){
    var x;
    if(x=o.addEventListener)x(et,fn,0);
    else if(x=o.attachEvent){
        o['e'+et+fn]=fn;
        o[et+fn]=function(){o['e'+et+fn](window.event);}
        x('on'+et,o[et+fn]);
    }
}
function omo(id){
    s_objectID=id;
}

var colorscheme='';
var dlscheme = new Array();
var c=0;
var tkr='';
var dlini=false;
var to=null;
var pto=null;
var dlnum=1;
var nDls=1;
var dlnext = new Array();
var dldur=80;
var dllast;
var qfcs;
var troflags = new Array();
var dlpops = new Array();
var pd;
var psed=false;
var fitab='';
var pctrl_flag = 1;

function dlinit(){
    if(dlini)return;
    dlini=true;
    to=setTimeout('dlgo()',getdldur(dlnum));
    if(p_o('pt'+dlnum))pt();
}
function pt(){
    if(!pd)return;
    c++;
    if(c==pd.length)c=0;
    pto=setTimeout('pt()',3000);
}
function dlf(){
    if(pctrl_flag == 1) {
        p_o('dlpi').className="dlpi";
        pctrl_flag = 0;
    } else
        psed = true;
    return dlgo('FWD');
}
function dlb(){return dlgo('BAK')}
function dlgo(typ,num){
    var fcsId='dlC';
    dlini=true;
    dllast=dlnum;
    switch(typ){
        case 'NUM':
            if(dlnum==num)return false;
            clrT();
            dlnum=num;
            psed=true;
            break;
        case 'BAK':
            clrT();
            dlnum--;
            psed=true;
            break;
        case 'FWD':
            clrT();
            dlnum++;
            break;
        default:
            if(!psed) dlnum++;
            fcsId=null;
            break;
    }
    if(dlnum>nDls){
        dlnum=1;
    }else if(dlnum<1){
        dlnum=nDls;
    }
    if(nDls!=1){
        var pUrl = '';
        if(dlpops['dl'+dlnum]) {
            pUrl += '&dlitem='+dlpops['dl'+dlnum];
        }
        pGet('',dlnum,'dlt','dlC','dlc()',null,fcsId);
    }

    if (p_o("dyn_sqrblock")) {
        for (var i=1; i<=nDls; i++) {
            if (p_o("dl_sqr"+i)) {
                if (i == dlnum)
                    p_o("dl_sqr"+i).style.background = "#FFF";
                else
                    p_o("dl_sqr"+i).style.background = "#BABABA";
            }
        }
    }
    setPse();
    return false;
}
function dlc() {
    dlteaser();
    dlcnt();
    if(!psed){
        to=setTimeout('dlgo()',getdldur(dlnum));
    }
}
function dlcnt() {
    if (p_o('dlcount')) {
        p_o('dlcount').innerHTML = dlnum + '/' + nDls;
    }
}
function dlteaser() {
    if (p_o('dlnext')) {
        if (dlnum == nDls) {
            nextDL = 1;
        } else {
            nextDL = dlnum + 1;
        }
        if (dlnext[nextDL]) {
            p_o('dlnext').innerHTML = dlnext[nextDL];
        } else {
            p_o('dlnext').innerHTML = '';
        }
    }
}
function dlblr() {
    qfcs=0;
}
function dlfcs() {
    qfcs=1;
}
function dlp(){
    if(psed){
        psed=false;
        to=setTimeout('dlgo()',getdldur(dlnum));
    }else{
        psed=true;
        clrT();
    }
    setPse();
    return false;
}
function setPse(){
    if(!p_o('dlpi'))return;
    if(psed){
        p_o('dlpi').className="dlpi_off";
    }else{
        p_o('dlpi').className="dlpi";
    }
}
function track(id,once) {
    if(!(o=p_o(id)))return;
    if(once && troflags[id]){
        return;
    }
    var d=o.innerHTML;
    var urls=d.split(",");
    if(once)troflags[id] = 1;
}
function clrT(){
    if(to){
        clearTimeout(to);
    to=null;
    }
}

ae(window,'load',dlinit);

function getdldur(dlnum) {
    if (o=p_o('dlcyc'+dlnum)) {
        return (o.innerHTML * 1000);
    }
    return dldur;
}

var vnTitle = null;

function thisObj(te) {
	vnTitle=null;
	if (te.title) {
		vnTitle=te.title;
	} else if (te.firstChild.nodeName=='IMG') {
		imgEle = te.firstChild;
		if (imgEle.title) {
			vnTitle=imgEle.title;
		} else if(imgEle.alt) {
			vnTitle=imgEle.alt;
		} else {
			vnTitle="";
		}
	} else {
		vnTitle=te.innerHTML.replace(/<(\S+).*>(.*)<\/\1>/, "$2").replace(/<(.*)\/>/, "").replace(/( *)(.*)( *)/,"$2").replace(/<(.*)>/,"");
                vnTitle=vnTitle.replace(/'/,"_q_");
        }
}

function popNewWindow( url, name, hght, wdth, params ) {
        if (vnTitle!=null) {
                if (url.indexOf('?')>0) {
                        url=url+"&vn="+vnTitle;
                } else {
                        url=url+"?vn="+vnTitle;
                }
                vnTitle=null;
	} 
	if(window.name!=name){
		var w = 480, h = 340;
		w = window.screen.width;
		h = window.screen.height;
		var leftPos = (w-wdth)/2, topPos = (h-hght)/2;
		var windprop = "width=" + wdth + ",height=" + hght + ",top=" + topPos + ",left=" + leftPos + "," +params;
		var descWindow =window.open(url,name,windprop);
	} else {
		document.location.href=url;
	}
	var nullValue;
	return nullValue;
}

function getParameter( name ) {
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var tmpURL = window.location.href;
  var results = regex.exec( tmpURL );
  if( results == null )
    return "";
  else
    return results[1];
}

function checkCategory(listID, thisPage) {
    var list = document.getElementById(listID);
    var items = list.getElementsByTagName("li");
    var itemsId = "";
    var re = /\/$/;
    for (var i = 0; i < items.length; i++) {
        itemsId = items[i].id;
        if (thisPage == "index" && re.test(itemsId)) { 
            items[i].className = "active";
            break;
        }
        if (itemsId == thisPage  + ".jhtml") {
            items[i].className = "active";
            break;
        }
    }
}

function toggleCityguideDropDown( count ) {
    if( !psed ) dlp();
    var el  = document.getElementById( "moreEvents_" + count );
    var lis = document.getElementById( "remainderEvents_" + count ).getElementsByTagName( "li" );

    if( el.className == "moreEvents" ) {
        el.className = "moreEvents_display";
        for( var i = 0; i < lis.length; i++ ) {
            lis[i].className = "pi_Arrow displayEvents";
        }
    } else if ( el.className == "moreEvents_display" ) {
        el.className = "moreEvents";
        for( var i = 0; i < lis.length; i++ ) {
            lis[i].className = "pi_Arrow hiddenEvents";
        }
    }

    //Now return a null or undefined value so this can be used in an href attribute of an anchor tag.
    var nullVariable;
    return nullVariable;
}
function setHomePage() {
	if(document.all){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(window.location.href);
		return false;
	} else {
		//document.location.href="sethomepage.jhtml";
		return true;
	}
}

function ReadCookie(n) {
	var cookiecontent = new String();
	cookiecontent="";
	if(document.cookie.length > 0) {
		var cookiename = n+ '=';
		var cookiebegin = document.cookie.indexOf(cookiename);
		var cookieend = 0;
		if(cookiebegin > -1) {
			cookiebegin += cookiename.length;
			cookieend = document.cookie.indexOf(";",cookiebegin);
			if(cookieend < cookiebegin) { 
				cookieend = document.cookie.length; 
			}
			cookiecontent = document.cookie.substring(cookiebegin,cookieend);
		} 
	}
	return unescape(cookiecontent); 
}   

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=/";
}

function toggleView(view) 
{
	var scrval ="";
	scrval=ReadCookie("resolution")=="wide"? "narrow" : ReadCookie("resolution")=="narrow"? "wide" : screen.width > 800 ? "wide" : "narrow" ;
	if(view=="init" && scrval=="wide") { 
		domviewChange();
	} else if(navigator.cookieEnabled==false && view!="init") {
		if(window.location.href.indexOf("?view") == -1) {
			window.location.href=window.location.href + "?view=" + (scrval=="narrow"? "wide": "narrow" );
		} else { 
			window.location.href=document.getElementById("togglehref").href;
		}
	}
        if(navigator.cookieEnabled==true) {
		createCookie("resolution",scrval,365);
		if(view!="init") {
			document.location.reload();
		}
	}
}

function removeNode(parentNode,nodeToBeDeletedId) {
        var parentNode=document.getElementById(parentNode);
        var processNode=parentNode.childNodes.item(0);
        while(processNode.id!=nodeToBeDeletedId) {
              processNode=processNode.nextSibling;
        }
        parentNode.removeChild(processNode);
}

function classSetter(nodeId, applyClass, overRide) {
        var node=document.getElementById(nodeId);
        node.className=typeof(overRide)=="undefined" ? node.className + " " + applyClass : applyClass;
}

function domviewChange() {
	document.body.style.cssText="width:942px !important;_width:945px !important;";
	var th=document.getElementById("togglehref");
	th.href=th.href.replace("wide","narrow");
	var ti=th.getElementsByTagName("IMG")[0];
	ti.src=ti.src.replace("wide","narrow");
	removeNode("column1","tosnav");
	removeNode("column2","tosprod");
	classSetter("toshatlnks","toshatlnks_or");
	classSetter("toshatcon","toshatcon_or");
	classSetter("searchcon" ,"searchcon_or");
	classSetter("content","content content_or");
	classSetter("column1","column1_or");
	classSetter("column2","column2_or");
	classSetter("footer","footer_or");
	classSetter("column0hide","column0",true);
	var ch=document.getElementById("column0hide");
	ch.id="column0";
}

var old_active_tab=null;
function activateTabByTagID(id){
if(old_active_tab!=null) {
        document.getElementById(old_active_tab).style.display="none";
       var tabid=new String(old_active_tab).replace("tc","t");
      document.getElementById(tabid).className="";
}
document.getElementById(id).style.display="block";
var tabid=new String(id).replace("tc","t");
document.getElementById(tabid).className="active";
old_active_tab=id;
}

