/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
			anchor.getAttribute("rel") == "external")
		anchor.target = "_blank";
		}
	}
window.onload = externalLinks;


/*
CSS Browser Selector v0.3.3 (Sep 09, 2009)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:/opera(\s|\/)(\d+)/.test(ua)?'opera opera'+RegExp.$2:is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);



var request2 = false;
var removeloading = 0;
var removeloading2 = 0;
﻿if (window.XMLHttpRequest) {
	// code for IE7+, Firefox, Chrome, Opera, Safari
	request2 = new XMLHttpRequest();
}

if (window.ActiveXObject) {
	// code for IE6, IE5
	request2 = new ActiveXObject("Microsoft.XMLHTTP");
}


function getPhotos() {
     var url = "/services/photofetch.php?s=s&n=9&tag=hostingcon2009";
     request2.open("GET", url, true);
     request2.onreadystatechange = updatePhotos;
     request2.send(null);
}

function getinnerPhotos() {
     var url = "/services/photofetch.php?s=s&n=9&tag=hostingcon2009";
     request2.open("GET", url, true);
     request2.onreadystatechange = updateinnerPhotos;
     request2.send(null);
}


function updatePhotos() {
//	var width = 100;
    if (request2.readyState == 4) {
       if (request2.status == 200) {
                if (request2.responseText!="") {

                var response2 = request2.responseText.split("|");
                document.getElementById('photoDiv').innerHTML = '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[0] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[1] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[2] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[3] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[4] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[5] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[6] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[7] + '"></a>';
                document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[8] + '"></a>';
		//document.getElementById('photoDiv').innerHTML += '<br class="clearLeft" /><a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[9] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[10] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[11] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[12] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[13] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[14] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[15] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[16] + '"></a>';
                //document.getElementById('photoDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[17] + '"></a>';
                }

        }
    }
}

function updateinnerPhotos() {
//	var width = 100;
    if (request2.readyState == 4) {
       if (request2.status == 200) {
                if (request2.responseText!="") {

                var response2 = request2.responseText.split("|");
                document.getElementById('photoinnerDiv').innerHTML = '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[0] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[1] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[2] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[3] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[4] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[5] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[6] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[7] + '"></a>';
                document.getElementById('photoinnerDiv').innerHTML += '<a rel="external" href="http://www.flickr.com/search/?w=all&q=hostingcon2009&m=tags"><img src="' + response2[8] + '"></a>';
                }

        }
    }
}

var ii2 = window.setInterval("getPhotos()",10000);

var J = jQuery.noConflict();