var xmlHttp

function Cache() {
songlink = String.fromCharCode(112,108,97,121,46,112,104,112,63,116,105,116,108,101,61);
document.getElementById("cache1").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"1&playerMode=embedded' /></embed>";
document.getElementById("cache2").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"2&playerMode=embedded' /></embed>";
document.getElementById("cache3").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"3&playerMode=embedded' /></embed>";
document.getElementById("cache4").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"4&playerMode=embedded' /></embed>";
document.getElementById("cache5").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"5&playerMode=embedded' /></embed>";
document.getElementById("cache6").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"6&playerMode=embedded' /></embed>";
document.getElementById("cache7").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"7&playerMode=embedded' /></embed>";
document.getElementById("cache8").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"8&playerMode=embedded' /></embed>";
document.getElementById("cache9").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"9&playerMode=embedded' /></embed>";
document.getElementById("cache10").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"10&playerMode=embedded' /></embed>";
document.getElementById("cache11").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"11&playerMode=embedded' /></embed>";
document.getElementById("cache12").innerHTML = "<embed type='application/x-shockwave-flash' src='http://www.google.com/reader/ui/3247397568-audio-player.swf' width='400' height='27' quality='high' flashvars='audioUrl=http://www.kamla.org.uk/"+songlink+"12&playerMode=embedded' /></embed>";
}

function scaleimage(imageid, bigsize, imagedivid) {
var imagestyle=document.getElementById(imageid).style;
if (imagestyle.width != bigsize+"px") {
new Effect.Morph(imageid, {
style: 'width: '+bigsize+'px'
});
//document.getElementById("nptext").style.clear = 'both';
//var newmargin = (820-bigsize)/2;
//document.getElementById(imagedivid).style.marginLeft = newmargin+"px";
//if (imagedivid == "image2div") { document.getElementById(imagedivid).style.top = "-155px"; document.getElementById('image1div').style.left = newmargin+"px"; }
} else if (imagestyle.width == bigsize+"px") {
new Effect.Morph(imageid, {
style: 'width: 200px'
});
//document.getElementById("nptext").style.clear = 'none';
//document.getElementById(imagedivid).style.marginLeft = "0px";
//if (imagedivid == "image2div") { document.getElementById(imagedivid).style.top = "0px"; document.getElementById('image1div').style.left = "0px"; }
}
}

function keepaway(divtitle) {
Effect.Fade(divtitle, {duration: 0.5, queue: 'front'});
Effect.Shrink("overlay", {duration: 1.0, queue: 'end'});
}

function nppopup(id)
{
Effect.SlideDown("overlay", {duration: 0.5, queue: 'front'});
Effect.Appear("picturediv", {duration: 1.0, queue: 'end'});

var pageHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;

document.getElementById("overlay").style.height = pageHeight+"px";

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="/nptext.php";
url=url+"?id="+id;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function Browser() {
link = String.fromCharCode(112,108,97,121,46,112,104,112,63,115,111,110,103,61);
}

function nppopup2(id)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="/nptext.php";
url=url+"?id="+id;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{
if (xmlHttp.readyState==4)
{
document.getElementById('picturediv').innerHTML=xmlHttp.responseText;
}
}

function gallerypopup(picture, picwidth, picheight, leftmargin) {

picheight = picheight -0;

Effect.SlideDown("overlay", {duration: 0.5, queue: 'front'});
Effect.Appear("gallerydiv", {duration: 1.0, queue: 'end'});

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="/gallerypic.php";
url=url+"?picture="+picture;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

browser=navigator.appName;
if (browser=="Microsoft Internet Explorer") { picheight = picheight + 9; }

var pageHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
document.getElementById("overlay").style.height = pageHeight+"px";

document.getElementById('gallerydiv').style.width = picwidth+"px";
document.getElementById('gallerydiv').style.height = picheight+"px";
document.getElementById('gallerydiv').style.marginLeft = leftmargin+"px";

}

function gallerypopup2(picture, picwidth, picheight, leftmargin) {

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="/gallerypic.php";
url=url+"?picture="+picture;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

document.getElementById('gallerydiv').style.width = picwidth+"px";
document.getElementById('gallerydiv').style.height = picheight+"px";
document.getElementById('gallerydiv').style.marginLeft = leftmargin+"px";

}

function stateChanged2() 
{
if (xmlHttp.readyState==4)
{
document.getElementById('gallerydiv').innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}