try{
var strcodepays = geoip_country_code();
var strpays=geoip_country_name();
var strcity=geoip_city() || geoip_region_name();
var strloc = "";
strloc= geoip_latitude() + "|" + geoip_longitude();
var strgeoip = "";
strgeoip = strcodepays + ":" + strpays + ":" + strcity + ":" + strloc;
}catch(e){};

var ITRSS = 0

function window_onload()
{

document.getElementById("btnOPML").style.display = "none";
//document.getElementById("divfluxrss").innerHTML ="";
 if(document.location.search)
 { 
  var valparam =  $_GET("url");
  if(valparam != "-1" && valparam != "")
  {
   document.getElementById("divfluxrss").innerHTML = "<img src='img/activity.gif' alt =''>";
   window.document.getElementById("txturlsite").value = valparam;
   window.document.getElementById("go").click();
  }

 }

}


function $_GET(strparam)
{

 var requrl = document.location.search;
 var valparam = "-1";   
 
if(requrl.substring(0,2) != "?&")
	requrl2 = requrl.substring(1);
  else
	requrl2 = requrl.substring(2);

 var tabparam = requrl2.split("&");

 for(i=0;i<tabparam.length;i++) 		
  {
    if( tabparam[i].split("=")[0].toLowerCase() == strparam.toLowerCase()) 
     {
      valparam = tabparam[i].split("=")[1];
      if(typeof(valparam) == "undefined") valparam = "";
      break;	
     }
  }

return unescape(valparam);
}


function MinOPML()
{

window.document.getElementById("divopmlrss").style.display = "none";

}

function MaxOPML()
{
window.document.getElementById("divopmlrss").style.display = "block";
}

function CloseOPML()
{


if(window.document.getElementById("IFRMFILEOPML"))
{
var oIFRMTMP = window.document.getElementById("IFRMFILEOPML");
var odiv = window.document.getElementById("divopmlrss");
odiv.removeChild(oIFRMTMP);
}

document.getElementById("btnOPML").style.display = "none";
window.document.getElementById("divopmlrss").style.height = "0px";
window.document.getElementById("divopmlrss").style.display = "block";

}


function getlink(idelem)
{

var strsite = unescape(document.getElementById("txturlsite").value);
if(strsite == "") return;
var strsitetmp = strsite.replace(/https:/i,"http:");
strsite = strsitetmp;
if(!strsite.match(/http:\/\//i))
  strsite = "http://" + strsite;
//document.location.href="lecteurinline.php?&urlrss=" + escape(strsite);
//document.getElementById("divopmlrss").style.height = 300 + (150 * (NBIMPOPML))  + "px";
getrequest("rss.php?&urlrss=" + escape(strsite),document.getElementById(idelem));

//document.getElementById("divfluxrss").style.backgroundColor = "black";
MinOPML();
document.getElementById("divfluxrss").innerHTML = "<img src='img/activity.gif' alt =''>";

window.clearInterval(ITRSS);
ITRSS = window.setInterval("javascript:scandivend()",7000);

}

function scandivend()
{
if(document.getElementById('divend'))
{ 
//window.clearInterval(ITRSS);
document.getElementById('divfluxrss').style.height = (document.getElementById('divend').offsetTop - document.getElementById('divfluxrss').offsetTop) + "px";
}
}

function validurl(evt,idelem)
{
 if(window.ActiveXObject)
 { 
 if(window.event.keyCode == 13) 
    { window.event.returnValue = false; 

	getlink(idelem);
    }	
 }
 else
 {
 if(evt.which == 13)
	getlink(idelem);
 }

}
function getrequest(strurl,objElem)
{ 

var strxml;
//alert(strurl)
//strurl = unescape(strurl);


		try
		{
		 if (window.XMLHttpRequest)
		 {  
			oxmlhttp = new XMLHttpRequest();

			if(document.layers)	 //netscape
			{		pref("signed.applets.codebase_principal_support", true);
					pref("security.checkloaduri", true);
					netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
			     	//oxmlhttp.overrideMimeType("text/xml;utf-8"); //OK a utiliser pour netscape
			     	oxmlhttp.overrideMimeType("text/html;charset=iso-8859-1"); //OK a utiliser pour netscape

					oxmlhttp.open("GET",strurl,true);			//true:asynchrone
			}					
			else
			{
			//oxmlhttp.overrideMimeType("text/xml"); //OK
			oxmlhttp.open("GET",strurl,true);   // true obligatoire
			//oxmlhttp.setRequestHeader("content-type","text/html;charset=iso-8859-1"); // pour une reponseXML
			oxmlhttp.setRequestHeader("content-type","text/xml;charset=utf-8"); // pour une reponseXML			
			}
			oxmlhttp.send(null);  
			oxmlhttp.onreadystatechange = function()
			{  
				//alert(oxmlhttp.responseText.length)
                         
					 try
					 {
						if (oxmlhttp.readyState == 4){
							if (oxmlhttp.status == 200) {
							 strxml = oxmlhttp.responseText;
							sizeFile = strxml.length;
						 	//alert(strxml)							
							objElem.innerHTML =strxml;
							
						  }
						}
					 }catch(e){};	
			}
		  }
		
		 }catch(e){}		
}

function ImportOpmlRss()
{

if(document.getElementById("IFRMFILEOPML"))
{
document.getElementById("IFRMFILEOPML").src="";
var oIFRMTMP = document.getElementById("IFRMFILEOPML");

var odiv = document.getElementById("divopmlrss");
odiv.removeChild(oIFRMTMP);
//document.getElementById("divopmlrss").style.height = window.screen.availHeight;

}
document.getElementById("btnOPML").style.display = "none";
document.getElementById("divopmlrss").style.display = "block";
document.getElementById("divopmlrss").style.height = "210px";


var oIFRM = document.createElement('iframe');
oIFRM.id = "IFRMFILEOPML";
oIFRM.src="http://www.singularite.info/up.html";
oIFRM.width="100%";
//oIFRM.height=window.screen.availHeight;
oIFRM.height="210px";
oIFRM.align="center";
oIFRM.valign="center";

oIFRM.frameBorder=0;

//alert(document.getElementById("divopmlrss").getAttribute("height"));
//document.getElementById("divopmlrss").style.height = (300 * NBIMPOPML)  + "px";
//alert(document.getElementById("divopmlrss").getAttribute("height"));
var odiv = document.getElementById("divopmlrss");
odiv.appendChild(oIFRM);

}


function frmfeedrss()
{
//var ITRSS = window.setTimeout("javascript:alert(document.getElementById('divend').offsetTop);","500","javascript");
//document.getElementById('divfluxrss').style.height = document.getElementById('divend').offsetTop + "px"
}

