﻿<!--
//begin of biketat script
var requestURL = 'http://www.feedtrends.com/'; 
var nErrorMsg1 = 'Browser Error!';
var is_ie = (navigator.userAgent.indexOf('MSIE') >= 0) ? 1 : 0; 
var is_ie5 = (navigator.appVersion.indexOf("MSIE 5.5")!=-1) ? 1 : 0; 
var is_opera = ((navigator.userAgent.indexOf("Opera 6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)) ? 1 : 0; 
//netscape, safari, mozilla behave the same??? 
var is_netscape = (navigator.userAgent.indexOf('Netscape') >= 0) ? 1 : 0; 
var nSessPage = new Array();
nSessPage[0] = '/signup.aspx';
nSessPage[1] = '/directory/add.aspx';
nSessPage[2] = '/directory/add_tips.aspx';
nSessPage[3] = '/activate.aspx';
nSessPage[4] = '/analytics/default.aspx';
nSessPage[5] = '/analytics/';
nSessPage[6] = '/analytics';
var xmlHttp; 
var xsltProcessor;
var xsl;

function LoadRequest(source, nXSLT)
{
    var url = requestURL + source;
	nXSLT = requestURL + nXSLT;
	if(document.implementation && document.implementation.createDocument)
	{
		try
		{
			xsltProcessor = new XSLTProcessor();
			xmlHttp = new XMLHttpRequest();
			xmlHttp.open("GET", nXSLT, false);
			xmlHttp.send(null);
			xslStylesheet = xmlHttp.responseXML;
			xsltProcessor.importStylesheet(xslStylesheet);
			xmlHttp.onreadystatechange = xmlhttpChange;
			xmlHttp.open("GET", url, true);
			xmlHttp.setRequestHeader("If-Modified-Since","20");
			xmlHttp.send(null);
    		}
    		catch(e)
    		{ alert(nErrorMsg1); }
	}
	else if(window.ActiveXObject)
	{
			xsl = new ActiveXObject("MSXML2.DOMDocument");
			xsl.async = false;
			xsl.load(nXSLT);
			var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP'; 
			xmlHttp = new ActiveXObject(strObjName);
			xmlHttp.onreadystatechange = xmlhttpChange;
			xmlHttp.open('GET', source, true);
			xmlHttp.setRequestHeader("If-Modified-Since","20");
			xmlHttp.send(null);
	}
	else
	{ alert(nErrorMsg1); }
}

function xmlhttpChange()
{
	if (xmlHttp.readyState==4)
	{
		//setTimeout("xmlhttpResponse()", 300);
		xmlhttpResponse();
  	} else {
		var sLoading = "<table width=\"570\" height=\"400px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style='background-color: #f1f1f1;'><tr><td align=\"center\" valign=\"middle\"><img src='images/loading.gif' border='0' width='16' height='16'/>&#160;&#160;<font style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size:14px;'>loading ...</font></td></tr></table>";
		document.getElementById("DivContentL").innerHTML = sLoading;
	}
}

function xmlhttpResponse() {
		var sError = "<table width=\"570\" height=\"210px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"center\" valign=\"middle\"><font style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size:14px;'>Error! Please try again later.</font></td></tr></table>";
  		if (xmlHttp.status==200)
   		{
			if(document.implementation && document.implementation.createDocument)
			{
				var xmlSource = xmlHttp.responseXML;
				var resultDocument = xsltProcessor.transformToFragment(xmlSource, document);
				for (r=resultDocument.childNodes.length-1;r>=0;r--) {
					if (resultDocument.childNodes[r].nodeValue == null) {
						var tmpBox = document.createElement("div");
						tmpBox.appendChild(resultDocument);
						func_displayOutput(document.getElementById('DivContentL'), tmpBox.innerHTML);
						break;
					}
				}
				//func_displayOutput(document.getElementById('DivContentL'), resultDocument.childNodes[0].innerHTML);
			}
			else
			{
                var xml = new ActiveXObject("Microsoft.XMLDOM");
                xml.async = false;
                xml.load(xmlHttp.responseXML);
                var sOut = xml.transformNode(xsl);
				func_displayOutput(document.getElementById('DivContentL'), sOut);
			}
			eval("if (document.getElementById('pos1')!=null){myMarked(document.getElementById('pos1'), 1);myMarked(document.getElementById('pos1'), 0);}");
   		}
		else
   		{
			document.getElementById("DivContentL").innerHTML = sError;
   		}
}

var cur_i = 1, cur_j = 1;

function n()
{}

function ClickDivR(id, takeE)
{
	if (typeof takeE == "undefined") takeE = true;
    var i;
    var nodeTR = id.parentNode.parentNode;
    var nodesTD = nodeTR.childNodes;
    
    for (i=0; i<5; i++)    
    {
		if ((i/2) != Math.round(i/2)) continue;
        if (id.parentNode==nodesTD[i])
        {

            //nodesTD[i].style.background = i==0 ? 'url(images/li_topbg.gif)' : 'url(images/li_topbg.gif)';
			nodesTD[i].style.background = 'url(images/li_topbg.gif)';
            nodesTD[i].className = 'rnav';
            nodesTD[i].childNodes[0].childNodes[0].className = 'rnav';
			if (takeE)
				ChangeDivContentR(i/2+1);
			else
				ChangeDivContentR(i/2+1, false);
        }
        else
        {
            //nodesTD[i].style.background = i==0 ? 'url(images/grey_topbg.gif)' : 'url(images/grey_topbg.gif)';
			nodesTD[i].style.background = 'url(images/grey_topbg.gif)';
            nodesTD[i].className = 'rnav01';
            nodesTD[i].childNodes[0].childNodes[0].className = 'rnav01';        
        }
    }    
}
function ChangeDivContentR(i, takeE)
{
	if (typeof takeE == "undefined") takeE = true;
    switch(i)
    {
    case 3:
		if (navigator.userAgent.indexOf('MSIE') >= 0) {
			if (takeE) DivContentAll_R.filters[0].Apply();
			document.getElementById("tBox_activate").style.display = "block";
			document.getElementById("tBox_login").style.display = "none";
			document.getElementById("tBox_register").style.display = "none";
			if (takeE) DivContentAll_R.filters[0].Play();
		} else {
			if (takeE) changeOpac(0, document.getElementById("DivContentAll_R").id);
			document.getElementById("tBox_activate").style.display = "block";
			document.getElementById("tBox_login").style.display = "none";
			document.getElementById("tBox_register").style.display = "none";
			if (takeE) opacity(document.getElementById("DivContentAll_R").id, 0, 100, 300);
		}
        break;
    case 1:
		if (navigator.userAgent.indexOf('MSIE') >= 0) {
			if (takeE) DivContentAll_R.filters[0].Apply();
			document.getElementById("tBox_activate").style.display = "none";
			document.getElementById("tBox_login").style.display = "block";
			document.getElementById("tBox_register").style.display = "none";
			if (takeE) DivContentAll_R.filters[0].Play();
		} else {
			if (takeE) changeOpac(0, document.getElementById("DivContentAll_R").id);
			document.getElementById("tBox_activate").style.display = "none";
			document.getElementById("tBox_login").style.display = "block";
			document.getElementById("tBox_register").style.display = "none";
			if (takeE) opacity(document.getElementById("DivContentAll_R").id, 0, 100, 300);
		}
        break;
    case 2:
		if (navigator.userAgent.indexOf('MSIE') >= 0) {
			if (takeE) DivContentAll_R.filters[0].Apply();
			document.getElementById("tBox_activate").style.display = "none";
			document.getElementById("tBox_login").style.display = "none";
			document.getElementById("tBox_register").style.display = "block";
			if (takeE) DivContentAll_R.filters[0].Play();
		} else {
			if (takeE) changeOpac(0, document.getElementById("DivContentAll_R").id);
			document.getElementById("tBox_activate").style.display = "none";
			document.getElementById("tBox_login").style.display = "none";
			document.getElementById("tBox_register").style.display = "block";
			if (takeE) opacity(document.getElementById("DivContentAll_R").id, 0, 100, 300);
		}
        break;
    }    
}

function ClickDivL(id)
{ 
    var i;
    var nodeTR = id.parentNode.parentNode;
    var nodesTD = nodeTR.childNodes;
    
    for (i=0; i<7; i++)    
    {
		if ((i/2) != Math.round(i/2)) continue;
        if (id.parentNode==nodesTD[i])
        {
            nodesTD[i].style.background = 'url(images/li_topbg.gif)';
            nodesTD[i].className = 'rnav';
            nodesTD[i].childNodes[0].childNodes[0].className = 'rnav';
            ChangeDivContentL(i/2+1,GetSubDiv());
        }
        else
        {
            nodesTD[i].style.background = 'url(images/grey_topbg.gif)';
            nodesTD[i].className = 'rnav01';
            nodesTD[i].childNodes[0].childNodes[0].className = 'rnav01';        
        }
    }    
}

function ClickSubDivL(id)
{ 
    var i;
    var nodeTR = id.parentNode.parentNode;
    var nodesTD = nodeTR.childNodes;
    
    for (i=0; i<4; i++)    
    {
		if ((i/2) != Math.round(i/2)) continue;
        if (id.parentNode==nodesTD[i])
        {

            nodesTD[i].style.background = 'url(images/li_topbg.gif)';
            nodesTD[i].className = 'rnav';
            nodesTD[i].childNodes[0].childNodes[0].className = 'rnav';
            ChangeDivContentL(cur_i,i/2+1);
        }
        else
        {
            nodesTD[i].style.background = 'url(images/grey_topbg.gif)';
            nodesTD[i].className = 'rnav01';
            nodesTD[i].childNodes[0].childNodes[0].className = 'rnav01';        
        }
    }    
}

function GetSubDiv()
{
    return document.getElementById("subdiv1").className=='rnav'? 1:2
}

function ChangeDivContentL(i,j)
{
//    if (cur_i==i && cur_j==j)
//        return;

	var xmlfile = "";
	var xsltfile = "";
    switch (i)
    {
    case 1:
    	xmlfile = "directory/rss/mostpop";
		xsltfile = "ft_directory_mostpop.xsl";
    	break;
    case 2:
    	xmlfile = "directory/rss/mostup";
		xsltfile = "ft_directory_mostup.xsl";
    	break;
    case 3:
    	xmlfile = "directory/rss/toppro";
		xsltfile = "ft_directory_toppro.xsl";
    	break;
    case 4:
    	xmlfile = "directory/rss/random";
		xsltfile = "ft_directory_random.xsl";
    	break;
    }
    xmlfile += j==1 ? "?t=feed":"?t=article";
    LoadRequest(xmlfile, xsltfile);
    
    cur_i = i; 
    cur_j = j;    
    return;   
}

function myMarked(theCells, nType) {
    var currentColor = null;
	var newColor = '#faf4e2'.toLowerCase();
	var oldColor = '#f7f7f7'.toLowerCase();
	var clickColor = '#f6f6f6'.toLowerCase();
	var oldBorder = '#D4D4D4'.toLowerCase();
	var clickBorder = '#fd8b05'.toLowerCase();
	
	try { currentColor = theCells.style.backgroundColor.toLowerCase(); }
	catch (e) { currentColor = theCells.getAttribute('bgcolor').toLowerCase(); }
	
	if (currentColor.indexOf("rgb") >= 0) {
		var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1, currentColor.indexOf(')'));
		var rgbValues = rgbStr.split(",");
		currentColor = "#";
		var hexChars = "0123456789ABCDEF";
		for (var i = 0; i < 3; i++) {
			var v = rgbValues[i].valueOf();
			currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
		}
		currentColor = currentColor.toLowerCase();
	}

	if (currentColor == newColor) {
		try {
			if (nType) {
			    theCells.style.backgroundColor = clickColor;
			    theCells.style.border = '1px solid ' + clickBorder;
			} else { theCells.style.backgroundColor = oldColor; }
			currentColor = theCells.style.backgroundColor;
		} catch (e) {
			if (nType) {
			    theCells.setAttribute('bgcolor', clickColor, 0);
			    theCells.setAttribute('border', '1px solid ' + clickBorder, 0);
			} else { theCells.setAttribute('bgcolor', oldColor, 0); }
			currentColor = theCells.getAttribute('bgcolor');
		}
	} else {
		try {
			if (nType) {
			    theCells.style.backgroundColor = clickColor;
			    theCells.style.border = '1px solid ' + clickBorder;
			} else { theCells.style.backgroundColor = newColor; }
			currentColor = theCells.style.backgroundColor;
		} catch (e) {
			if (nType) {
			    theCells.setAttribute('bgcolor', clickColor, 0);
			    theCells.setAttribute('border', '1px solid ' + clickBorder, 0);
			} else { theCells.setAttribute('bgcolor', newColor, 0); }
			currentColor = theCells.getAttribute('bgcolor');
		}
	}
	
	if (nType) {
		for(i=1;i<=10;i++) {
			if (document.getElementById('pos'+i) == null) break;
			if (document.getElementById('pos'+i) != theCells) {
				try {
					document.getElementById('pos'+i).style.backgroundColor = oldColor;
					document.getElementById('pos'+i).style.border = '1px solid ' + oldBorder;
				} catch (e) {
					document.getElementById('pos'+i).setAttribute('bgcolor', oldColor, 0);
					document.getElementById('pos'+i).setAttribute('border', '1px solid ' + oldBorder, 0);
				}
			}
		}
	}
	
	return true;
}

function myMarkedDetail(theCells, nType) {
    var currentColor = null;
	var newColor = '#faf4e2'.toLowerCase();
	var oldColor = '#f7f7f7'.toLowerCase();
	var clickColor = '#f6f6f6'.toLowerCase();
	var oldBorder = '#D4D4D4'.toLowerCase();
	var clickBorder = '#fd8b05'.toLowerCase();
	
	try { currentColor = theCells.style.backgroundColor.toLowerCase(); }
	catch (e) { currentColor = theCells.getAttribute('bgcolor').toLowerCase(); }
	
	if (currentColor.indexOf("rgb") >= 0) {
		var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1, currentColor.indexOf(')'));
		var rgbValues = rgbStr.split(",");
		currentColor = "#";
		var hexChars = "0123456789ABCDEF";
		for (var i = 0; i < 3; i++) {
			var v = rgbValues[i].valueOf();
			currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
		}
		currentColor = currentColor.toLowerCase();
	}

	if (currentColor == clickColor) {
		if (nType) {
			try {
			    theCells.style.backgroundColor = newColor;
			    theCells.style.border = '1px solid ' + oldBorder;
			}
			catch (e) {
			    theCells.setAttribute('bgcolor', newColor, 0);
			    theCells.setAttribute('border', '1px solid ' + oldBorder, 0);
			}
		}
	} else if (currentColor == newColor) {
		try {
			if (nType) {
			    theCells.style.backgroundColor = clickColor;
			    theCells.style.border = '1px solid ' + clickBorder;
			} else { theCells.style.backgroundColor = oldColor; }
			currentColor = theCells.style.backgroundColor;
		} catch (e) {
			if (nType) {
			    theCells.setAttribute('bgcolor', clickColor, 0);
			    theCells.setAttribute('border', '1px solid ' + clickBorder, 0);
			} else { theCells.setAttribute('bgcolor', oldColor, 0); }
			currentColor = theCells.getAttribute('bgcolor');
		}
	} else {
		try {
			if (nType) {
			    theCells.style.backgroundColor = clickColor;
			    theCells.style.border = '1px solid ' + clickBorder;
			} else { theCells.style.backgroundColor = newColor; }
			currentColor = theCells.style.backgroundColor;
		} catch (e) {
			if (nType) {
			    theCells.setAttribute('bgcolor', clickColor, 0);
			    theCells.setAttribute('border', '1px solid ' + clickBorder, 0);
			} else { theCells.setAttribute('bgcolor', newColor, 0); }
			currentColor = theCells.getAttribute('bgcolor');
		}
	}
	return true;
}

function func_displayOutput(obj, str) {
	if (navigator.userAgent.indexOf('MSIE') >= 0) {
		DivContentAll.filters[0].Apply();
		obj.innerHTML = str;
		DivContentAll.filters[0].Play();
	} else {
		changeOpac(0, obj.id);
		obj.innerHTML = str;
		opacity(obj.id, 0, 100, 300);
	}
}

function func_display2Output(obj, str) {
	if (navigator.userAgent.indexOf('MSIE') >= 0) {
		DivDirectoryAll.filters[0].Apply();
		obj.innerHTML = str;
		DivDirectoryAll.filters[0].Play();
	} else {
		changeOpac(0, obj.id);
		obj.innerHTML = str;
		opacity(obj.id, 0, 100, 300);
	}
}

function func_display3Output(obj, str) {
	if (navigator.userAgent.indexOf('MSIE') >= 0) {
		DivDirectoryFeatured.filters[0].Apply();
		obj.innerHTML = str;
		DivDirectoryFeatured.filters[0].Play();
	} else {
		changeOpac(0, obj.id);
		obj.innerHTML = str;
		opacity(obj.id, 0, 100, 300);
	}
}

function func_detailShow(num) {
	if (navigator.userAgent.indexOf('MSIE') >= 0) {
		detailShowLayer.filters[0].Apply();
		if (document.getElementById('deImg0') != null) document.getElementById('deImg0').innerHTML = document.getElementById('deImg'+num).innerHTML;
		if (document.getElementById('deTitle0') != null) document.getElementById('deTitle0').innerHTML = document.getElementById('deTitle'+num).innerHTML;
		if (document.getElementById('dePublished0') != null) document.getElementById('dePublished0').innerHTML = document.getElementById('dePublished'+num).innerHTML;
		if (document.getElementById('deProvider0') != null) document.getElementById('deProvider0').innerHTML = document.getElementById('deProvider'+num).innerHTML;
		if (document.getElementById('deDesc0') != null) document.getElementById('deDesc0').innerHTML = document.getElementById('deDesc'+num).innerHTML;
		if (document.getElementById('dePageViews0') != null) document.getElementById('dePageViews0').innerHTML = document.getElementById('dePageViews'+num).innerHTML;
		if (document.getElementById('dePoints0') != null) {
			document.getElementById('dePoints0').innerHTML = '';
			for (m=num;m<=document.getElementById('dePoints'+num).innerHTML;m++)
				document.getElementById('dePoints0').innerHTML += '<img src="images/star.png" border="0"/>&#160;';
			for (m=num-1;m>0;m--)
				document.getElementById('dePoints0').innerHTML += '<img src="images/star_no.png" border="0"/>&#160;';
		}
		detailShowLayer.filters[0].Play();
	} else {
		changeOpac(0, "detailShowLayer");
		if (document.getElementById('deImg0') != null) document.getElementById('deImg0').innerHTML = document.getElementById('deImg'+num).innerHTML;
		if (document.getElementById('deTitle0') != null) document.getElementById('deTitle0').innerHTML = document.getElementById('deTitle'+num).innerHTML;
		if (document.getElementById('dePublished0') != null) document.getElementById('dePublished0').innerHTML = document.getElementById('dePublished'+num).innerHTML;
		if (document.getElementById('deProvider0') != null) document.getElementById('deProvider0').innerHTML = document.getElementById('deProvider'+num).innerHTML;
		if (document.getElementById('deDesc0') != null) document.getElementById('deDesc0').innerHTML = document.getElementById('deDesc'+num).innerHTML;
		if (document.getElementById('dePageViews0') != null) document.getElementById('dePageViews0').innerHTML = document.getElementById('dePageViews'+num).innerHTML;
		if (document.getElementById('dePoints0') != null) {
			document.getElementById('dePoints0').innerHTML = '';
			for (m=num;m<=document.getElementById('dePoints'+num).innerHTML;m++)
				document.getElementById('dePoints0').innerHTML += '<img src="images/star.png" border="0"/>&#160;';
			for (m=num-1;m>0;m--)
				document.getElementById('dePoints0').innerHTML += '<img src="images/star_no.png" border="0"/>&#160;';
		}
		opacity('detailShowLayer', 0, 100, 300);
	}
}

function opacity(id, opacStart, opacEnd, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;

	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

//******
function func_waitButton(objName, nWait) {
	if (nWait) {
		document.getElementById(objName).disabled=true;
		document.getElementById(objName).value=document.getElementById(objName).value+" ...";
	} else {
		document.getElementById(objName).disabled=false;
		document.getElementById(objName).value=document.getElementById(objName).value.substr(0, document.getElementById(objName).value.length-4);
	}
}

function func_tBox_register() {
	location.href = "/signup.aspx?username=" + escape(document.tBox_frmRegister.tBox_username.value) + '&email=' + escape(document.tBox_frmRegister.tBox_email.value);
	//alert("Sorry! Not ready at this stage.");
}

function func_tBox_activate() {
	func_waitButton("tBox_submitA", true);
	document.tBox_frmActivate.submit();
	return true;
}

function func_tBox_activate2() {
    func_waitButton("tBox_submitA", true);
    location.href = requestURL + 'directory/add.aspx?url=' + escape(document.getElementById("tBox_url").value) + '&urlType=tbox';
    return false;
}

function func_tBox_loginMsg(objName) {
	if (objName == "all") {
		var allOK = true;
		if (document.getElementById("tBox_username").value.length == 0) {
			document.getElementById("tBox_usernameMsg").style.display="block";
			allOK = false;
		}
		if (document.getElementById("tBox_password").value.length == 0) {
			document.getElementById("tBox_passwordMsg").style.display="block";
			allOK = false;
		}
		return allOK;
	} else {
		if (document.getElementById(objName).value.length == 0)
			document.getElementById(objName+"Msg").style.display="block";
		else
			document.getElementById(objName+"Msg").style.display="none";
		return false;
	}
}

var xml1Http = false;
function func_tBox_login() {
	if (!func_tBox_loginMsg("all"))
		return;
	try {
		xml1Http = new ActiveXObject("Microsoft.XMLhttp");
	} catch (e) {
		xml1Http = false;
	}
	if (!xml1Http && typeof XMLHttpRequest!='undefined') {
		try {
			xml1Http = new XMLHttpRequest();
		} catch (e) {
			xml1Http=false;
		}
	}
	if (!xml1Http && window.createRequest) {
		try {
			xml1Http = window.createRequest();
		} catch (e) {
			xml1Http=false;
		}
	}
	func_waitButton("tBox_submitL", true);
	xml1Http.open("GET","tBox_login.aspx?t=t&ln="+escape(document.tBox_frmLogin.tBox_username.value)+"&pwd="+escape(document.tBox_frmLogin.tBox_password.value)+"&rm="+((document.tBox_frmLogin.tBox_rememberMe.checked)?"1":"0")+"&url="+escape(document.tBox_frmActivate.tBox_url.value),true);
	xml1Http.setRequestHeader("If-Modified-Since","20");
	xml1Http.send(null);
	xml1Http.onreadystatechange=server1Process;
}

function server1Process() {
	if (xml1Http.readyState==4 || xml1Http.readyState=='complete') {
  		if (xml1Http.status==200) {
			func_waitButton("tBox_submitL", false);
			try {
				var xml1node = xml1Http.responseXML.documentElement.childNodes;
				var jjj = 0;
				for(var i=0;i<xml1node.length;i++) {
					if (xml1node[i].tagName) {
						if (jjj==0) {
							if (xml1node[i].firstChild.nodeValue < 1) {
								document.getElementById("tBox_loginErrMsg").style.display="block";
								return;
							}
						} else {
							if (xml1node[i].attributes[0] == null) {
								//document.getElementById(xml1node[i].tagName).innerHTML = xml1node[i].firstChild.nodeValue;
								document.getElementById(xml1node[i].tagName).innerHTML = func_getNodeValue(xml1node[i]);
							} else {
								if (xml1node[i].attributes[0].nodeValue == "script")
									eval(xml1node[i].firstChild.nodeValue);
							}
						}
						jjj++;
					}
				}
			} catch (e) {
				document.getElementById("tBox_loginErrMsgX").style.display="block";
			}
   		}
	}
}

//===============================================
var xml2Http; 
var xslt2Processor;
var xsl2;

function Load2Request(source, nXSLT) {
    var url = requestURL + source;
	nXSLT = requestURL + nXSLT;
	if(document.implementation && document.implementation.createDocument) {
		try {
			xslt2Processor = new XSLTProcessor();
			xml2Http = new XMLHttpRequest();
			xml2Http.open("GET", nXSLT, false);
			xml2Http.send(null);
			xslStylesheet = xml2Http.responseXML;
			xslt2Processor.importStylesheet(xslStylesheet);
			xml2Http.onreadystatechange = xmlhttp2Change;
			xml2Http.open("GET", url, true);
			xml2Http.setRequestHeader("If-Modified-Since","20");
			xml2Http.send(null);
    	} catch(e) { alert(nErrorMsg1); }
	} else if(window.ActiveXObject) {
		xsl2 = new ActiveXObject("MSXML2.DOMDocument");
		xsl2.async = false;
		xsl2.load(nXSLT);
		var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';
		xml2Http = new ActiveXObject(strObjName); 
	  	xml2Http.onreadystatechange = xmlhttp2Change;
	    xml2Http.open('GET', source, true);
		xml2Http.setRequestHeader("If-Modified-Since","20");
	    xml2Http.send(null); 
	} else { alert(nErrorMsg1); }
}

function xmlhttp2Change() {
	if (xml2Http.readyState==4) {
		//setTimeout("xmlhttp2Response()", 300);
		xmlhttp2Response();
  	} else {
		var sLoading = "<table width=\"570\" height=\"400px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style='background-color: #fbfeee;'><tr><td align=\"center\" valign=\"middle\"><img src='images/loading.gif' border='0' width='16' height='16'/>&#160;&#160;<font style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size:14px;'>loading ...</font></td></tr></table>";
		document.getElementById("DivDirectoryL").innerHTML = sLoading;
	}
}

function xmlhttp2Response() {
		var sError = "<table width=\"570\" height=\"210px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"center\" valign=\"middle\"><font style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size:14px;'>Error! Please try again later.</font></td></tr></table>";
  		if (xml2Http.status==200) {
			if(document.implementation && document.implementation.createDocument) {
				var xmlSource = xml2Http.responseXML;
				var resultDocument = xslt2Processor.transformToFragment(xmlSource, document);
				for (r=resultDocument.childNodes.length-1;r>=0;r--) {
					if (resultDocument.childNodes[r].nodeValue == null) {
						var tmpBox = document.createElement("div");
						tmpBox.appendChild(resultDocument);
						func_display2Output(document.getElementById('DivDirectoryL'), tmpBox.innerHTML);
						break;
					}
				}
				//func_display2Output(document.getElementById('DivDirectoryL'), resultDocument.childNodes[0].innerHTML);
				eval("go_decoding1();go_decoding2();go_decoding3();func_fillPoints();");
				if (xml2Http.responseXML.documentElement.getElementsByTagName('ft_labelJS')[0] != null) eval(xml2Http.responseXML.documentElement.getElementsByTagName('ft_labelJS')[0].firstChild.data);
			} else {
                var xml = new ActiveXObject("Microsoft.XMLDOM");
                xml.async = false;
                xml.load(xml2Http.responseXML);
                var sOut = xml.transformNode(xsl2);
				func_display2Output(document.getElementById('DivDirectoryL'), sOut);
				eval("go_decoding1();go_decoding2();go_decoding3();func_fillPoints();");
				if (xml2Http.responseXML.documentElement.getElementsByTagName('ft_labelJS')[0] != null) eval(xml2Http.responseXML.documentElement.getElementsByTagName('ft_labelJS')[0].text);
			}
   		} else {
			document.getElementById("DivDirectoryL").innerHTML = sError;
			//begin of handle preload javascript (3/3)
			//document.getElementById('search_dis2').style.visibility='visible';
			//end of handle preload javascript (3/3)
   		}
}

//===============================================
var xml3Http; 
var xslt3Processor;
var xsl3;

function Load3Request(source, nXSLT) {
    var url = requestURL + source;
	nXSLT = requestURL + nXSLT;
	if(document.implementation && document.implementation.createDocument) {
		try {
			xslt3Processor = new XSLTProcessor();
			xml3Http = new XMLHttpRequest();
			xml3Http.open("GET", nXSLT, false);
			xml3Http.send(null);
			xslStylesheet = xml3Http.responseXML;
			xslt3Processor.importStylesheet(xslStylesheet);
			xml3Http.onreadystatechange = xmlhttp3Change;
			xml3Http.open("GET", url, true);
			xml3Http.setRequestHeader("If-Modified-Since","20");
			xml3Http.send(null);
    	} catch(e) { alert(nErrorMsg1); }
	} else if(window.ActiveXObject) {
		xsl3 = new ActiveXObject("MSXML2.DOMDocument");
		xsl3.async = false;
		xsl3.load(nXSLT);
		var strObjName = (is_ie5) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';
		xml3Http = new ActiveXObject(strObjName); 
	  	xml3Http.onreadystatechange = xmlhttp3Change;
	    xml3Http.open('GET', source, true);
		xml3Http.setRequestHeader("If-Modified-Since","20");
	    xml3Http.send(null); 
	} else { alert(nErrorMsg1); }
}

function xmlhttp3Change() {
	if (xml3Http.readyState==4) {
		//setTimeout("xmlhttp3Response()", 300);
		xmlhttp3Response();
  	} else {
		var sLoading = "<table width=\"570\" height=\"135px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style='background-color: #fbfeee;'><tr><td align=\"center\" valign=\"middle\"><img src='images/loading.gif' border='0' width='16' height='16'/>&#160;&#160;<font style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size:14px;'>loading ...</font></td></tr></table>";
		document.getElementById("DivDirectoryFF").innerHTML = sLoading;
	}
}

function xmlhttp3Response() {
		var sError = "<table width=\"570\" height=\"135px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"center\" valign=\"middle\"><font style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size:14px;'>Error! Please try again later.</font></td></tr></table>";
  		if (xml3Http.status==200) {
			if(document.implementation && document.implementation.createDocument) {
				var xmlSource = xml3Http.responseXML;
				var resultDocument = xslt3Processor.transformToFragment(xmlSource, document);
				for (r=resultDocument.childNodes.length-1;r>=0;r--) {
					if (resultDocument.childNodes[r].nodeValue == null) {
						var tmpBox = document.createElement("div");
						tmpBox.appendChild(resultDocument);
						func_display3Output(document.getElementById('DivDirectoryFF'), tmpBox.innerHTML);
						break;
					}
				}
				//func_display3Output(document.getElementById('DivDirectoryFF'), resultDocument.childNodes[0].innerHTML);
				eval("go_decoding3();");
			} else {
                var xml = new ActiveXObject("Microsoft.XMLDOM");
                xml.async = false;
                xml.load(xml3Http.responseXML);
                var sOut = xml.transformNode(xsl3);
				func_display3Output(document.getElementById('DivDirectoryFF'), sOut);
				eval("go_decoding3();");
			}
   		} else {
			document.getElementById("DivDirectoryFF").innerHTML = sError;
   		}
}

//===============================================
var xml4textPre = "";
var xml4Http = false;
function func_tBox_getContentR2() {
	try {
		xml4Http = new ActiveXObject("Microsoft.XMLhttp");
	} catch (e) {
		xml4Http = false;
	}
	if (!xml4Http && typeof XMLHttpRequest!='undefined') {
		try {
			xml4Http = new XMLHttpRequest();
		} catch (e) {
			xml4Http=false;
		}
	}
	if (!xml4Http && window.createRequest) {
		try {
			xml4Http = window.createRequest();
		} catch (e) {
			xml4Http=false;
		}
	}
	xml4textPre = document.getElementById("tBox_activate").innerHTML;
	document.getElementById("tBox_activate").innerHTML = "<table width='100%' style='height:136px;' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='middle'><img src='images/loading.gif' width='16' height='16' /></td></tr></table>";
	xml4Http.open("GET","tBox_getContentR2.aspx?t=t",true);
	xml4Http.setRequestHeader("If-Modified-Since","20");
	xml4Http.send(null);
	xml4Http.onreadystatechange=server4Process;
}

function server4Process() {
	if (xml4Http.readyState==4 || xml4Http.readyState=='complete') {
  		if (xml4Http.status==200) {
			try {
				var xml4text = xml4Http.responseText;
				document.getElementById("tBox_activate").innerHTML = xml4text;
			} catch (e) {
				document.getElementById("tBox_activate").innerHTML = xml4textPre;
			}
   		}
	}
}

//===============================================

function func_fillPoints() {
	if (document.getElementById('dePoints0') != null) {
		var num = 1;
		var Tnum = parseInt(document.getElementById('dePoints0').innerHTML);
		for (m=num;m<=Tnum;m++) {
			if (document.getElementById('deNum' + m) != null) {
				for (n=Tnum;n>=parseInt(document.getElementById('deNum' + m).innerHTML);n--)
					document.getElementById('dePoints' + m).innerHTML += '<img src="images/star.png" border="0"/>&#160;';
				for (n=(parseInt(document.getElementById('deNum' + m).innerHTML))-1;n>0;n--)
					document.getElementById('dePoints' + m).innerHTML += '<img src="images/star_no.png" border="0"/>&#160;';
			}
		}
	}
}

        function func_onChangeSelectFilterDateRange(nO) {
			location.href=func_queryString('qd=', nO.options[nO.selectedIndex].value);
        }
        function func_onChangeSelectFilterPodcast(nO) {
			location.href=func_queryString('podcast=', nO.options[nO.selectedIndex].value);
        }
        function func_onChangeSelectSorting(nO) {
			location.href=func_queryString('qs=', nO.options[nO.selectedIndex].value);
        }
        function func_onChangeSelectShow(nO) {
			location.href=requestURL+'directory'+func_queryString2('show=', nO.options[nO.selectedIndex].value, func_queryString2('page=', 1, location.search));
			//location.href=func_queryString('show=', nO.options[nO.selectedIndex].value);
        }
		function func_onChangeSelectShowRandom(nO) {
			location.href=func_queryString('show=', nO.options[nO.selectedIndex].value);
        }
		function func_queryString(nQS, nValue) {
			//nQS -> 'show='
            if (location.search.indexOf(nQS) > 0) {
                var nShowS = location.search.indexOf(nQS)+nQS.length;
                var nShowE = location.search.substring(nShowS, location.search.length).indexOf('&');
                if (nShowE >= 0)
                    return requestURL+'directory'+location.search.substring(0, location.search.indexOf(nQS))+nQS+nValue+location.search.substring(nShowS+nShowE,10240);
                else
                    return requestURL+'directory'+location.search.substring(0, location.search.indexOf(nQS))+nQS+nValue;
	        } else {
		        re = /\?/;
		        if (!re.test(location.href))
			        return requestURL+'directory'+location.search+'?'+nQS+nValue;
		        else
		            return requestURL+'directory'+location.search+'&'+nQS+nValue;
		    }
		}
		function func_queryString2(nQS, nValue, nURL) {
			//nQS -> 'show='
            if (nURL.indexOf(nQS) > 0) {
                var nShowS = nURL.indexOf(nQS)+nQS.length;
                var nShowE = nURL.substring(nShowS, nURL.length).indexOf('&');
                if (nShowE >= 0)
                    return nURL.substring(0, nURL.indexOf(nQS))+nQS+nValue+nURL.substring(nShowS+nShowE,10240);
                else
                    return nURL.substring(0, nURL.indexOf(nQS))+nQS+nValue;
	        } else {
		        re = /\?/;
		        if (!re.test(location.href))
			        return nURL+'?'+nQS+nValue;
		        else
		            return nURL+'&'+nQS+nValue;
		    }
		}
function func_copyClip(meintext)
{
	if (window.clipboardData) {
		window.clipboardData.setData("Text", meintext);   
	} else if (window.netscape) {
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
			var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
			if (!clip) return;
			var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
			if (!trans) return;
			trans.addDataFlavor('text/unicode');
			var str = new Object();
			var len = new Object();
			var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
			var copytext=meintext;
			str.data=copytext;
			trans.setTransferData("text/unicode",str,copytext.length*2);
			var clipid=Components.interfaces.nsIClipboard;
			if (!clip) return false;
			clip.setData(trans,null,clipid.kGlobalClipboard);
		} catch (e) {
			alert("Can't access the Clipboard. Please allow access and try again.");
		}
	}
//		alert("Copied to clipboard:\n\n" + meintext);
		return false;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}

function preLyr()
{
	if (document.getElementById("lyr_searchOptions").style.display == 'none') {
		if (document.getElementById("qd_") != null)
			document.getElementById("qd_").style.visibility='hidden';
		if (document.getElementById("podcast_") != null)
			document.getElementById("podcast_").style.visibility='hidden';
		if (document.getElementById("qs_") != null)
			document.getElementById("qs_").style.visibility='hidden';
		if (document.getElementById("selectShow") != null)
			document.getElementById("selectShow").style.visibility='hidden';
		document.getElementById("lyr_searchOptionsImg").innerHTML = '<img src="images/collapse.gif" border="0" width="9" height="9" />';
		setLyr(document.getElementById("q"), "lyr_searchOptions");
		document.getElementById("lyr_searchOptionsCollapse").innerHTML = document.getElementById("lyr_searchOptionsExpand").innerHTML;
		if (document.getElementById("ctl00_Label1") != null)
			document.getElementById("lyr_searchOptionsExpand").innerHTML = '<font style="visibility:hidden;">'+document.getElementById("ctl00_Label1").innerHTML+"</font>";
		if (document.getElementById("ctl00_ctl00_Label1") != null)
			document.getElementById("lyr_searchOptionsExpand").innerHTML = '<font style="visibility:hidden;">'+document.getElementById("ctl00_ctl00_Label1").innerHTML+"</font>";
	} else {
		if (document.getElementById("qd_") != null)
			document.getElementById("qd_").style.visibility='visible';
		if (document.getElementById("podcast_") != null)
			document.getElementById("podcast_").style.visibility='visible';
		if (document.getElementById("qs_") != null)
			document.getElementById("qs_").style.visibility='visible';
		if (document.getElementById("selectShow") != null)
			document.getElementById("selectShow").style.visibility='visible';
		document.getElementById("lyr_searchOptionsImg").innerHTML = '<img src="images/expand.gif" border="0" width="9" height="9" />';
		clrLyr("lyr_searchOptions");
		document.getElementById("lyr_searchOptionsExpand").innerHTML = document.getElementById("lyr_searchOptionsCollapse").innerHTML;
		document.getElementById("lyr_searchOptionsCollapse").innerHTML = '&#160;';
	}
}

function setLyr(obj,lyr)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	var x = new getObj(lyr);
	if (is_ie >= 1)
		x.style.top = (newY + 21) + 'px';
	else if (navigator.userAgent.indexOf('Firefox/2.0') >= 0)
		x.style.top = (newY + 23) + 'px';
	else
		x.style.top = (newY + 21) + 'px';
	x.style.left = newX + 'px';
	x.style.display = 'block';
}

function clrLyr(lyr)
{
	var x = new getObj(lyr);
	x.style.display = 'none';
}

function func_searchSubmit() {
	document.Form0.submit();
}

function func_searchHelp() {
    if (document.getElementById("lyr_searchHelp").style.display == "none")
        document.getElementById("lyr_searchHelp").style.display = "block";
    else
        document.getElementById("lyr_searchHelp").style.display = "none";
}

function func_subscribeToOthers(nLink) {
	var subscribeToOthers_str = '';
	
	if (is_ie)
		subscribeToOthers_str += '					<div style="text-align:justify;text-justify:newspaper;line-height: 25px;">';
	else
		subscribeToOthers_str += '					<div style="text-align:justify;text-justify:newspaper;line-height: 25px;position:relative; top:5px;">';
	subscribeToOthers_str += '						<a href="http://fusion.google.com/add?feedurl=' + nLink + '"><img  alt="Add to Google" src="images/add2_google.gif" border="0" /></a>';
	subscribeToOthers_str += '						<a href="http://add.my.yahoo.com/rss?url=' + nLink + '"><img alt="Add to My Yahoo!" src="images/add2_yahoo.gif" border="0" /></a>';
	subscribeToOthers_str += '						<a href="http://www.bloglines.com/sub/' + nLink + '"><img alt="Subscribe with Bloglines" src="images/add2_bloglines.gif" border="0" /></a>';
	subscribeToOthers_str += '						<a href="http://www.netvibes.com/subscribe.php?url=' + nLink + '"><img alt="Add to netvibes" src="images/add2_netvibes.gif" border="0" /></a>';
	subscribeToOthers_str += '						<a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=' + nLink + '"><img alt="Subscribe in NewsGator Online" src="images/add2_newsgator.gif" border="0" /></a>';
	subscribeToOthers_str += '						<a href="http://feeds.my.aol.com/add.jsp?url=' + nLink + '"><img alt="Add to My AOL" src="images/add2_aol.gif" border="0" /></a>';
	subscribeToOthers_str += '						<a href="http://www.pageflakes.com/subscribe.aspx?url=' + nLink + '"><img alt="Add to pageflakes" src="images/add2_pageflakes.gif" border="0" /></a>';
	subscribeToOthers_str += '					</div>';
	return subscribeToOthers_str;
}

function func_add2Ex(nCC, nLink) {
	var nOutput = document.getElementById("lyr_add2Text" + nCC).innerHTML;
	document.getElementById("lyr_add2Text" + nCC).innerHTML = nOutput.replace("func_add2Ex", "func_add2Co").replace("[...]", "[.]").replace("#expandSubscribeButton", "#collapseSubscribeButton");
	document.getElementById("lyr_add2Desc" + nCC).style.display = "block";
	document.getElementById("lyr_add2Desc" + nCC).innerHTML = func_subscribeToOthers(nLink);
}

function func_add2Co(nCC, nLink) {
	var nOutput = document.getElementById("lyr_add2Text" + nCC).innerHTML;
	document.getElementById("lyr_add2Text" + nCC).innerHTML = nOutput.replace("func_add2Co", "func_add2Ex").replace("[.]", "[...]").replace("#collapseSubscribeButton", "#expandSubscribeButton");
	document.getElementById("lyr_add2Desc" + nCC).style.display = "none";
	document.getElementById("lyr_add2Desc" + nCC).innerHTML = '';
}

function func_getNodeValue(node) {
	if (node && node.hasChildNodes()) {
		var s="";
		for (var j=0;j<node.childNodes.length;j++) {
			s+=new String(node.childNodes.item(j).nodeValue);
		}
		return s;
	} else {
		return "";
	}
}

function func_AdvancedSearch() {
    var q = document.getElementById('q').value;
    if (q.length == 0) {
        location.href = '/directory/search_adv.aspx'
    } else {
        location.href = '/directory/search_adv.aspx?q=' + escape(q);
    }
}

function func_facebookConnect() {
	document.getElementById("lyr_facebookConnect").style.height = "1px";
	document.getElementById("lyr_facebookConnect_tbl").style.height = "1px";
	document.getElementById("lyr_facebookConnect_loading").style.height = "1px";
	document.getElementById("lyr_facebookConnect").style.display = "none";
	document.getElementById("lyr_facebookConnect_tbl").style.display = "none";
	document.getElementById("lyr_facebookConnect_loading").style.display = "none";
	window.iframe_facebookConnect.location.href="about:blank";
}

function func_editFacebookConnect() {
	var nlyr_facebookConnect_height = document.body.scrollHeight;
	if (screen.availHeight > document.body.scrollHeight && screen.height > 768) nlyr_facebookConnect_height = screen.availHeight;
	changeOpac(0, document.getElementById("lyr_facebookConnect").id);
	document.getElementById("lyr_facebookConnect").style.height = nlyr_facebookConnect_height + "px";
	document.getElementById("lyr_facebookConnect_tbl").style.height = document.documentElement.clientHeight + "px";
	document.getElementById("lyr_facebookConnect_loading").style.height = document.documentElement.clientHeight + "px";
	document.getElementById("lyr_facebookConnect").style.display = "block";
	document.getElementById("lyr_facebookConnect_tbl").style.display = "none";
	document.getElementById("lyr_facebookConnect_loading").style.display = "block";
	window.iframe_facebookConnect.location.href=requestURL+'signup_fb.aspx';
	document.body.scrollTop=0;
	window.scrollTo(0,0);
}

function func_calcHeightFacebookConnect()
{
	var myObj = document.getElementById('iframe_facebookConnect');
	if (myObj.contentDocument && myObj.contentDocument.body.offsetHeight) {
		myObj.height = myObj.contentDocument.body.offsetHeight;
	} else {
		myObj.height = myObj.contentWindow.document.body.scrollHeight;
	}
}
//end of biketat script
//-->
