function music(id) { 
		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null) {
			alert ("Browser does not support HTTP Request");
	 		return;
		}
		
		var url = "config/music.php?id="+id;
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);
	
		var x = document.getElementsByName('music').length; // tel al de div's die music heten op;
		var y = document.getElementsByName('music'); // maak soort van array die je dan kan aanroepen via y[int]
		// GET ID:  y[int].id  ==> int is een getal, zie onderstaande for-loop
		// FOR LOOP: ga elke div af die music heet, en zet het op play.
		for (a = 0; a < x; a++) {
			document.getElementById(y[a].id).innerHTML = '<img onclick="music(\''+y[a].id+'\')" style="margin-left: 5px;" src="/config/images/play.jpg" alt=""/>';
		}
		document.getElementById(id).innerHTML = '<img onclick="musicstop(\''+id+'\')" style="margin-left: 5px;" src="/config/images/stop.jpg" alt=""/>';	
}

function musicstop(id) {
	
	document.getElementById(id).innerHTML = '<img onclick="music(\'m_'+id+'\')" style="margin-left: 5px;" src="/config/images/play.jpg" alt=""/>';
	document.getElementById('ajaxdiv').innerHTML = '';
}

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;  
}


var xmlHttp

function showPhoto(albumid, photoid) { 

	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
 		return;
	}

	var url = "config/photoview.php?a="+albumid+"&p="+photoid;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}





function stateChanged() { 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
 		document.getElementById("ajaxdiv").innerHTML=xmlHttp.responseText
 	} 
}

function stateChanged1() { 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
 		document.getElementById("ajaxdiv1").innerHTML=xmlHttp.responseText
 	} 
}








/************************************************************************************************************
(C) www.dhtmlgoodies.com, September 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/	    
var charIndex = -1;
var stringLength = 0;
var inputText;
function writeContent(init, index){
	if(init){
		inputText = document.getElementById('contentToWrite'+index+'').innerHTML;
	}
    if(charIndex==-1){
        charIndex = 0;
        stringLength = inputText.length;
    }
    var initString = document.getElementById('myContent'+index+'').innerHTML;
	initString = initString.replace(/<SPAN.*$/gi,"");
    
    var theChar = inputText.charAt(charIndex);
   	var nextFourChars = inputText.substr(charIndex,4);
   	if(nextFourChars=='<BR>' || nextFourChars=='<br>'){
   		theChar  = '<BR>';
   		charIndex+=3;
   	}
    initString = initString + theChar + "<SPAN id='blink'>_</SPAN>";
    document.getElementById('myContent'+index+'').innerHTML = initString;

    charIndex = charIndex/1 +1;
	if(charIndex%2==1){
         document.getElementById('blink').style.display='none';
    }else{
         document.getElementById('blink').style.display='inline';
    }
            
    if(charIndex<=stringLength){
        setTimeout('writeContent(false, '+index+')',200);
    }else{
    	blinkSpan();
    }  
}

var currentStyle = 'inline';
function blinkSpan(){
	if(currentStyle=='inline'){
		currentStyle='none';
	}else{
		currentStyle='inline';
	}
	document.getElementById('blink').style.display = currentStyle;
	setTimeout('blinkSpan()',500);
	
}


