function load_flickr(catid,page,youtube)
{
	var total_pages=flickr_pages;
	//search_on=1;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	document.getElementById(youtube+"flickr_images").innerHTML = "<img src='http://media.santabanta.com/test/loading1.gif' style='margin:50px;'>";
	var url="/wallpapers/flickr.asp";
	url=url+"?catid="+catid;
	url=url+"&page="+page;
	if (youtube=="1")
	{
		url=url+"&youtube=1";
		total_pages=youtube_pages;
	}
	xmlHttp.onreadystatechange=function(){

if (xmlHttp.readyState==4)
	{ 
		var xmlRes = xmlHttp.responseText;
		document.getElementById(youtube+"flickr_images").innerHTML = xmlRes;
	}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	var start1=1;
	while (start1<=total_pages)
	{
	document.getElementById(youtube+"page"+start1).style.backgroundColor="#ffffff";
	start1=start1+1;
	}
	document.getElementById(youtube+"page"+page).style.backgroundColor="#cccccc";
} 

function show_flickr() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		var xmlRes = xmlHttp.responseText;
		document.getElementById(youtube+"flickr_images").innerHTML = xmlRes;
	}
}
var img_src = "";
var show = 0;
function showdiv1(url)
{
	img_src = url;
	if (show == 0)
	{
		overlay();
	}
	else if (show == 1)
	{
		hidediv1('inline');
	}
}
function hidediv1(obj)
{
	document.getElementById("menu_inner").innerHTML = "";
	document.getElementById("menu").style.display = obj;
	document.getElementById("menu_inner").style.display = obj;	
	if (obj == "inline")
	{
		var i_div = document.getElementById("menu_inner");
		i_div.className = "overlay_div_inner";
		i_div.style.height = "22px";
		i_div.style.width = "126px";
		i_div.style.backgroundColor = "#FFF";
		i_div.style.left = ((viewportwidth/2)-(126/2))+"px";
		i_div.style.top = ((viewportheight/2)-(22/2))+"px";	
		i_div.innerHTML = "<img id=\"big_image\" name=\"big_image\" src=\"http://media.santabanta.com/test/ajax.gif\" />";
		loadIMG();
	}
}

function style()
{
var html="<style type=\"text/css\">"
+" body{margin:0;border:0;height:100%;overflow-y:auto;}"
+" #menu{top:0px;position:fixed;}"
+" * html #menu {position:absolute;}"
+" #menu_inner{top:0px;position:fixed;}"
+" * html #menu_inner {position:absolute;}"
+" .overlay_div{-moz-opacity:0.6;opacity:.60;FILTER:alpha(opacity=60);background-color:#000;}";
html=html+"</style>";
document.write(html);
}
style();
var viewportwidth;
var viewportheight;
function overlay()
{
  	if (typeof window.innerWidth != 'undefined')
  	{
       	viewportwidth = window.innerWidth,
       	viewportheight = window.innerHeight
  	}
  	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
  	{
       	viewportwidth = document.documentElement.clientWidth,
       	viewportheight = document.documentElement.clientHeight
  	}
  	else
  	{
       	viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       	viewportheight = document.getElementsByTagName('body')[0].clientHeight
  	}
	var ol_div = document.createElement("div");
	ol_div.id = "menu";
	ol_div.className = "overlay_div";
	ol_div.style.height = viewportheight + "px";
	ol_div.style.width = viewportwidth + "px";
	document.body.appendChild(ol_div);
	var i_div = document.createElement("div");
	i_div.id  = "menu_inner";
	i_div.className = "overlay_div_inner";
	i_div.style.height = "22px";
	i_div.style.width = "126px";
	i_div.style.backgroundColor = "#FFF";
	i_div.style.left = ((viewportwidth/2)-(126/2))+"px";
	i_div.style.top = ((viewportheight/2)-(22/2))+"px";	
	i_div.innerHTML = "<img id=\"big_image\" name=\"big_image\" src=\"http://media.santabanta.com/test/ajax.gif\" />";	
	document.body.appendChild(i_div);	
	loadIMG();
	show = 1;
}

function loadIMG()
{
	if (img_src.substring(0,7) != "http://")
	{
		var html = "";
		html += "<div style=\"width:16px;height:14px;position:absolute;margin-left:" + (425+10) + "px;margin-top:-10px;\">";
		html += "<a href=\"javascript:void(0);\" onclick=\"hidediv1('none');\">";
		html += "<img alt=\"Close\" src=\"http://media.santabanta.com/test/close_profile.gif\" border=\"0\" />";
		html += "</a>";
		html += "</div>";
		html += "<embed src=\"http://www.youtube.com/v/" + img_src + "&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed>";

		var inner_div = document.getElementById("menu_inner");
		inner_div.style.height = "344px";
		inner_div.style.width = "425px";
		inner_div.style.left = ((viewportwidth/2)-(425/2))+"px";
		inner_div.style.top = ((viewportheight/2)-(344/2))+"px";//
		inner_div.className = "overlay_div_inner_new";
		inner_div.innerHTML = html;	
		return false;
	}
	var oImg = new Image();
   	oImg.expander = this;
   	oImg.onload = function()
	{
		var inner_div = document.getElementById("menu_inner");
		inner_div.style.height = oImg.height + "px";
		inner_div.style.width = oImg.width + "px";
		inner_div.style.left = ((viewportwidth/2)-(oImg.width/2))+"px";
		inner_div.style.top = ((viewportheight/2)-(oImg.height/2))+"px";//
		inner_div.className = "overlay_div_inner_new";
		inner_div.innerHTML = innerDIV(img_src,oImg.width,oImg.height);	
	}
   	oImg.src = encodeURI(img_src);
	
}

function innerDIV(img_src,width,height)
{
	var html = "";
	html += "<div style=\"width:16px;height:14px;position:absolute;margin-left:" + (width-16) + "px;margin-top:-2px;\">";
	html += "<a href=\"javascript:void(0);\" onclick=\"hidediv1('none');\">";
	html += "<img alt=\"Close\" src=\"http://media.santabanta.com/test/close_profile.gif\" border=\"0\" />";
	html += "</a>";
	html += "</div>";
	html += "<img src=\"" + img_src + "\" width=\""+ width +"\" height=\""+ height +"\" />";	
	return html;
}
function runvideo(id)
{
showdiv1(id);
}