
function vote(qid,ansid)
{
	
    var parameters="pollq_id="+qid;
    if(ansid!=0)
    {
        parameters+="&polla_aid="+ansid;
    }
    new Ajax.Updater("vote_flash","index.php/maincontroller/vote",{
        parameters:parameters,
        evalScripts:true
    });

}
/*
function livescores()
{
    var a=navigator.onLine;
 if(a){
    new Ajax.Updater("livescoreboard",getBaseURL()+"index.php/maincontroller/indexbar/",{
        evalScripts:true
    });
 }else{
  //alert('ofline');
//	 offline();
 }
 
 function offline()
{
   
     //   setTimeout("livescores()",1000000);


}


}
*/
function sitetrr()
{
   
	//alert(getBaseURL());
    new Ajax.Updater("trr",getBaseURL()+"index.php/maincontroller/trr/",{
        evalScripts:true
    });
	

}

function setvisible1()
{
   
      //  setTimeout("livescores()",1000000);


}

function getBaseURL() {
    var url = location.href;  // entire url including querystring - also: window.location.href;
    var baseURL = url.substring(0, url.indexOf('/', 14));


    if (baseURL.indexOf('http://localhost') != -1) {
        // Base Url for localhost
        var url = location.href;  // window.location.href;
        var pathname = location.pathname;  // window.location.pathname;
        var index1 = url.indexOf(pathname);
        var index2 = url.indexOf("/", index1 + 1);
        var baseLocalUrl = url.substr(0, index2);

        return baseLocalUrl + "/";
    }
    else {
        // Root Url for domain name
        return baseURL + "/";
    }

}

function onChangelocation(val)
{
	
    var parameters="locid="+val.value;
	//alert(parameters);

    new Ajax.Updater("add_id_div",getBaseURL()+"index.php/upload/getaddid/",{
        parameters:parameters,
        evalScripts:true
    });

}
