function LoadPage(value){
if(value=='tunein'){
LoadStream();
} else {
window.location = '?/'+value+'';	
}
}

var ajaxRequest = initAjaxRequest();
var ajaxRequest2 = initAjaxRequest();
var ajaxRequest_hotlistcounter = initAjaxRequest();
var ajaxRequest_favoritescounter = initAjaxRequest();
var ajaxRequest_friendscounter = initAjaxRequest();
var ajaxRequest_creditscounter = initAjaxRequest();
var ajaxRequest_messagecounter = initAjaxRequest();
var ajaxRequest_nowon = initAjaxRequest();
var ajaxRequest_nowonnlfm = initAjaxRequest();
var ajaxRequest_subtabs = initAjaxRequest();
var ajaxRequest_pic = initAjaxRequest();
var ajaxRequest_artistlistcounter = initAjaxRequest();


function initAjaxRequest() {
    var request;
	if (window.ActiveXObject) {
		request = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		request = new XMLHttpRequest();
	}
    return request;
}

function sendAjaxGetRequest(url, container) {
	
	var rand = Math.random();
	
    ajaxRequest.open('GET', ''+url+'&rand='+rand+'');
	ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			document.getElementById(container).innerHTML = ajaxRequest.responseText;
			addReflections();
		}
	}
    ajaxRequest.send(null);
}

function sendAjaxPostRequest(url, parameters, container) {
	
	var rand = Math.random();
	
    ajaxRequest.open('POST', ''+url+'&rand='+rand+'');
	ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
			document.getElementById(container).innerHTML = ajaxRequest.responseText;
		}
	}
    ajaxRequest.send(parameters);
}

function LoadStream(){
window.open("mediaplayer", 'MediaPlayer', 'width=795, height=445, toolbar=0, scrollbars=0, location=0, status=0, menubar=0, resizable=0, screenX=' + ((screen.width - 300) / 2) + ', screenY=' + ((screen.height - 150) / 2) + ', top=' + ((screen.height - 150) / 2) + ', left=' + ((screen.width - 300) / 2) + '')
}

function LoadRingtone(songID){
window.open("content/smashfm.content.ringtone.pop.php?songid="+songID+"", 'LoadRingtone', 'width=500, height=214, toolbar=0, scrollbars=0, location=0, status=0, menubar=0, resizable=0, screenX=' + ((screen.width - 500) / 2) + ', screenY=' + ((screen.height - 210) / 2) + ', top=' + ((screen.height - 210) / 2) + ', left=' + ((screen.width - 500) / 2) + '')
}

function SearchCommand(type,keyword){
ShowLoading('smashfm_search_results');
sendAjaxGetRequest('content/smashfm.content.search.results.inc.php?type='+type+'&keyword='+keyword+'', 'smashfm_search_results');
}

function ShowLoading(id){
		document.getElementById(id).innerHTML = '<div class=content>Loading...</div>';
}

// Ringtnio functies
img_speaker="http://www.ringtonio.nl/images/sp1.gif";
img_folder="http://www.ringtonio.nl/images/map1.gif";
mleft=110;
mtop=20;
bgplay="http://www.ringtonio.nl/images/standardplay.png";
bgsend="http://www.ringtonio.nl/images/standard.jpg";
d=document;
bd='http://www.ringtonio.nl';
d.writeln ('<link rel="stylesheet" type="text/css"'+
 ' href="http://www.ringtonio.nl/css/25922.css">');

function ringtone_send(id)
  {
  window.open("http://www.ringtonio.nl/send/?id="+id+
  "&rtaff=10489&clx=1&rtlo=25922",
  "sendpop","toolbar=no,location=no,directories=no,"+
  "status=yes,menubar=no,scrollbars=no,resizable=no,"+
  "copyhistory=no,width=590,height=470,screenX=0,"+
  "screenY=0,top=200,left=200");
  }

function ringtone_play(id)
  {
  window.open("http://www.ringtonio.nl/play/?id="+id+
  "&rtaff=10489&clx=1&rtlo=25922",
  "playpop","toolbar=no,location=no,directories=no"+
  ",status=no,menubar=no,scrollbars=no,resizable=no,"+
  "copyhistory=no,width=300,height=160,screenX=0,"+
  "screenY=0,top=200,left=200");
  }

function nix ()
  {
  return;
  }
// / Ringtonio functies

function SetStatus(status,redirect){
window.location = '?/setstatus/'+status+'/'+redirect+'';	
}

function NewCode(){
		var nr = Math.random();
 document.getElementById("captcha").src = "required/smashfm.captcha.php?i="+nr+"";
}

function FrontSearch(){
var s_keyword = document.getElementById("keyword").value;
window.location = '?/playlist/search/'+s_keyword+'';
}

function MemberSearch(){

var s_nickname = document.getElementById("s_nickname").value;
var s_place = document.getElementById("s_place").value;
var s_age = document.getElementById("s_age").value;
var s_gender = document.getElementById("s_gender").value;
var s_photo = document.getElementById("s_photo").value;

var query = ""+s_nickname+"|"+s_place+"|"+s_age+"|"+s_gender+"|"+s_photo+"";

window.location = '?/members/search/'+query+'';
}

function LoadChart(){
var week = document.getElementById('chart_week').value;
var year = document.getElementById('chart_year').value;

if(week==0||year==0){ } else {
window.location = '?/charts/mostrequested/'+week+'-'+year+'';
}
}

function SwitchRequestIcon(id,type){

 if(type=='over'){
 document.getElementById(''+id+'').src='images/smashfm.icon.request-a.gif';	
 }
 else {
 document.getElementById(''+id+'').src='images/smashfm.icon.request.gif';	
 } 
	
}

function SwitchFavoriteIcon(id,type){

 if(type=='over'){
 document.getElementById(''+id+'').src='images/smashfm.icon.setfavorite-a.gif';	
 }
 else {
 document.getElementById(''+id+'').src='images/smashfm.icon.setfavorite.gif';	
 } 
	
}

function SwitchArtistIcon(id,type){

 if(type=='over'){
 document.getElementById(''+id+'').src='images/smashfm.icon.setartist-a.gif';	
 }
 else {
 document.getElementById(''+id+'').src='images/smashfm.icon.setartist.gif';	
 } 
	
}

function SwitchLyricIcon(id,type){

 if(type=='over'){
 document.getElementById(''+id+'').src='images/smashfm.icon.lyrics-a.gif';	
 }
 else {
 document.getElementById(''+id+'').src='images/smashfm.icon.lyrics.gif';	
 } 
	
}


function SwitchDelFavoriteIcon(id,type){

 if(type=='over'){
 document.getElementById(''+id+'').src='images/smashfm.icon.deletefavorite-a.gif';	
 }
 else {
 document.getElementById(''+id+'').src='images/smashfm.icon.deletefavorite.gif';	
 } 
	
}

function SwitchDelIcon(id,type){

 if(type=='over'){
 document.getElementById(''+id+'').src='images/smashfm.icon.delete-a.gif';	
 }
 else {
 document.getElementById(''+id+'').src='images/smashfm.icon.delete.gif';	
 } 
	
}

// Show Sub tabs
function ShowSub(start,container,key,id){
	//document.getElementById(container).innerHTML='loading..<br><br>';
	//ajaxRequest_subtabs
	//sendAjaxGetRequest('components/smashfm.'+container+'.php?ajax=1&memberid='+memberid+'&start='+start+'', ''+container+'');
	var rand = Math.random();
   
   ajaxRequest_subtabs.open('GET', 'components/smashfm.'+container+'.php?ajax=1&key='+key+'&id='+id+'&start='+start+'&rand='+rand+'');
   ajaxRequest_subtabs.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_subtabs.onreadystatechange = function() {
   if (ajaxRequest_subtabs.readyState == 4) {
	document.getElementById(container).innerHTML=''+ajaxRequest_subtabs.responseText+'';
   }
	}
    ajaxRequest_subtabs.send(null);
	
}

// Show all
function ShowTextField(type,action,id){
	
if(action == 'more'){
		sendAjaxGetRequest('components/smashfm.'+type+'.php?ajax=1&artistid='+id+'', ''+type+'');
}
else {
		sendAjaxGetRequest('components/smashfm.'+type+'.php?artistid='+id+'&less=1', ''+type+'');
}
}

// Request song
function RequestSong(id, hash){
   
   var rand = Math.random();
   
   ajaxRequest.open('GET', 'request/req.php?songID='+id+'&hash='+hash+'&rand='+rand+'');
   ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest.onreadystatechange = function() {
   if (ajaxRequest.readyState == 4) {
	alert(""+ajaxRequest.responseText+"");
	UpdateCountCredits();
   }
	}
    ajaxRequest.send(null);
};

// Add To Hotlist
function AddToHotlist(id){
   
   ajaxRequest.open('POST', 'scripts/smashfm.addtohotlist.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			
			if(document.getElementById('addedtohotlist')){
			ShowSub('0','addedtohotlist','tracks',''+id+'');	
			}

			alert(''+ajaxRequest.responseText+''); UpdateCountHotlist();


    	}
	}
    ajaxRequest.send('songid='+id+'');
	
}

// Add To Favorites
function AddToFavorites(key,keyid){
   
   ajaxRequest.open('POST', 'scripts/smashfm.addtofavorites.php?1=');
   ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(''+ajaxRequest.responseText+''); UpdateCountFavorites();
    	}
	}
    ajaxRequest.send('key='+key+'&keyid='+keyid+'');
	
}


// Remove From Hotlist
function RemoveFromHotlist(id){
		
var agree=confirm("Weet je zeker dat je deze track wilt verwijderen?");

if (agree) {
	
   ajaxRequest.open('POST', 'scripts/smashfm.removefromhotlist.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(ajaxRequest.responseText); UpdateHotlist(); UpdateCountHotlist();
			}
	}
    ajaxRequest.send('songid='+id+'');
	
} else {
 return false;	
}

}

// Remove From Hotlist
function RemoveFromPhotos(id){
		
var agree=confirm("Weet je zeker dat je deze foto wilt verwijderen?");

if (agree) {
	
   ajaxRequest.open('POST', 'scripts/smashfm.removefrommemberphotos.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(ajaxRequest.responseText); UpdatePhotos();
			}
	}
    ajaxRequest.send('photoid='+id+'');
	
} else {
 return false;	
}

}


// Remove From Hotlist
function RemoveFromReactions(id,backurl){
		
var agree=confirm("Weet je zeker dat je deze reactie wilt verwijderen?");

if (agree) {
	
   ajaxRequest.open('POST', 'scripts/smashfm.removefromreactions.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(ajaxRequest.responseText); UpdateReactions(''+backurl+'');
			}
	}
    ajaxRequest.send('commendid='+id+'');
	
} else {
 return false;	
}

}

// Remove From Hotlist
function RemoveFromFavorites(id){
		
var agree=confirm("Weet je zeker dat je dit item wilt verwijderen?");

if (agree) {
	
   ajaxRequest.open('POST', 'scripts/smashfm.removefromfavorites.php?1=');
	ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(ajaxRequest.responseText); UpdateFavorites(); UpdateCountFavorites();
			}
	}
    ajaxRequest.send('favoriteid='+id+'');
	
} else {
 return false;	
}

}

// Remove From Artistlist
function AddToArtistlist(id){
   
   ajaxRequest.open('POST', 'scripts/smashfm.addtoartistlist.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
    	
			if(document.getElementById('addedtoartistlist')){
			ShowSub('0','addedtoartistlist','artists',''+id+'');	
			}

alert(''+ajaxRequest.responseText+''); UpdateCountHotlist();


		}
	}
    ajaxRequest.send('artistid='+id+'');
	
}

// Remove From Artistlist
function RemoveFromArtistlist(id){
		
var agree=confirm("Weet je zeker dat je deze artiest wilt verwijderen?");

if (agree) {
	
   ajaxRequest2.open('POST', 'scripts/smashfm.removefromartistlist.php?1=');
	 ajaxRequest2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest2.onreadystatechange = function() {
		if (ajaxRequest2.readyState == 4) {
			alert(ajaxRequest2.responseText);
			UpdateCountArtistlist();
			UpdateArtistlist(); 
			}
	}
    ajaxRequest2.send('artistid='+id+'');
	
} else {
 return false;	
}

}

// Add To Friendslist
function AddToFriends(id){
   
   ajaxRequest.open('POST', 'scripts/smashfm.addtofriends.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(''+ajaxRequest.responseText+'');
			UpdateCountFriends();
    	}
	}
    ajaxRequest.send('friendid='+id+'');
}

// Remove From Friendslist
function RemoveFromFriends(id){
	
	var agree=confirm("Weet je zeker dat je deze member wilt verwijderen?");

if (agree) {
        ajaxRequest.open('POST', 'scripts/smashfm.removefromfriends.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(ajaxRequest.responseText); UpdateFriends();
			}
	}
    ajaxRequest.send('friendid='+id+'');
}
else {
	return false ;
}
}


// Remove From Inbox
function RemoveFromInbox(id){
	
var agree=confirm("Weet je zeker dat je dit bericht wilt verwijderen?");

if (agree) {
     ajaxRequest.open('POST', 'scripts/smashfm.removefrominbox.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
     ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(ajaxRequest.responseText);
			UpdateInbox();
			UpdateCountMessages()
		}
	}
    ajaxRequest.send('messageid='+id+'');
}
else {
	return false ;
}
	
}

// Remove From Outbox
function RemoveFromOutbox(id){
	
var agree=confirm("Weet je zeker dat je dit bericht wilt verwijderen?");

if (agree) {
     ajaxRequest.open('POST', 'scripts/smashfm.removefromoutbox.php?1=');
	 ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
     ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			alert(ajaxRequest.responseText);
			UpdateOutbox();
			UpdateCountMessages()
		}
	}
    ajaxRequest.send('messageid='+id+'');
}
else {
	return false ;
}	
}

// Update Commends
function UpdateReactions(url){
 sendAjaxGetRequest(''+url+'', 'reactions');
}

// Update Photos
function UpdatePhotos(){
 sendAjaxGetRequest('components/smashfm.memberphotos.php?ajax=1', 'loadmemberphotos');
}

// Update Inbox
function UpdateInbox(){
 sendAjaxGetRequest('components/smashfm.inbox.php?ajax=1', 'inbox');
}

// Update Outbox
function UpdateOutbox(){
 sendAjaxGetRequest('components/smashfm.outbox.php?ajax=1', 'outbox');
}

// Update Hotlist-Counter
function UpdateCountHotlist(){
	
	var rand2 = Math.random();
   
   ajaxRequest_hotlistcounter.open('GET', 'scripts/smashfm.counthotlist.php?ajax=1&rand='+rand2+'');
   ajaxRequest_hotlistcounter.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_hotlistcounter.onreadystatechange = function() {
   if (ajaxRequest_hotlistcounter.readyState == 4) {
	document.getElementById("counthotlist").innerHTML = ajaxRequest_hotlistcounter.responseText;
   }
	}
    ajaxRequest_hotlistcounter.send(null);
}

// Update Favorites-Counter
function UpdateCountFavorites(){
	
	var rand2 = Math.random();
   
   ajaxRequest_favoritescounter.open('GET', 'scripts/smashfm.countfavorites.php?ajax=1&rand='+rand2+'');
   ajaxRequest_favoritescounter.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_favoritescounter.onreadystatechange = function() {
   if (ajaxRequest_favoritescounter.readyState == 4) {
	document.getElementById("countfavorites").innerHTML = ajaxRequest_favoritescounter.responseText;
   }
	}
    ajaxRequest_favoritescounter.send(null);
}

// Update Hotlist-Counter
function UpdateCountArtistlist(){
	
	var rand2 = Math.random();
   
   ajaxRequest_artistlistcounter.open('GET', 'scripts/smashfm.countartistlist.php?ajax=1&rand='+rand2+'');
   ajaxRequest_artistlistcounter.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_artistlistcounter.onreadystatechange = function() {
   if (ajaxRequest_artistlistcounter.readyState == 4) {
	document.getElementById("countartistlist").innerHTML = ajaxRequest_artistlistcounter.responseText;
   }
	}
    ajaxRequest_artistlistcounter.send(null);
}


// Update Friends-Counter
function UpdateCountFriends(){
	
   var rand2 = Math.random();
   
   ajaxRequest_friendscounter.open('GET', 'scripts/smashfm.countfriends.php?ajax=1&rand='+rand2+'');
   ajaxRequest_friendscounter.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_friendscounter.onreadystatechange = function() {
   if (ajaxRequest_friendscounter.readyState == 4) {
	document.getElementById("countfriends").innerHTML = ajaxRequest_friendscounter.responseText;
   }
	}
    ajaxRequest_friendscounter.send(null);
}

// Update Message-Counter
function UpdateCountMessages(){
	
	var rand2 = Math.random();
   
   ajaxRequest_messagecounter.open('GET', 'scripts/smashfm.countmessages.php?ajax=1&rand='+rand2+'');
   ajaxRequest_messagecounter.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_messagecounter.onreadystatechange = function() {
   if (ajaxRequest_messagecounter.readyState == 4) {
	document.getElementById("countmessages").innerHTML = ajaxRequest_messagecounter.responseText;
   }
	}
    ajaxRequest_messagecounter.send(null);
}

// Update Credits-Counter
function UpdateCountCredits(){
	
	var rand3 = Math.random();
   
   ajaxRequest_creditscounter.open('GET', 'scripts/smashfm.countcredits.php?ajax=1&rand='+rand3+'');
   ajaxRequest_creditscounter.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_creditscounter.onreadystatechange = function() {
   if (ajaxRequest_creditscounter.readyState == 4) {
	document.getElementById("countcredits").innerHTML = ajaxRequest_creditscounter.responseText;
   }
	}
    ajaxRequest_creditscounter.send(null);
}

// Update Hotlist
function UpdateHotlist(){
 sendAjaxGetRequest('components/smashfm.myhotlist.php?ajax=1', 'load_myhotlist');
}

// Update Favorites
function UpdateFavorites(){
 sendAjaxGetRequest('components/smashfm.myfavorites.php?ajax=1', 'load_myfavorites');
}

// Update Hotlist
function UpdateArtistlist(){
 sendAjaxGetRequest('components/smashfm.myartistlist.php?ajax=1', 'load_myartistlist');
}

// Update Friendslist
function UpdateFriends(){
 sendAjaxGetRequest('components/smashfm.myfriends.php?ajax=1', 'load_myfriends');
}

// Update "Now on Smash FM" screen (interval staat op 15000 in index.php)
function UpdateNowOn(){
		var rand2 = Math.random();
   
   ajaxRequest_nowon.open('GET', 'scripts/smashfm.nowon.php?type=now_artist&ajax=1&rand='+rand2+'');
   ajaxRequest_nowon.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_nowon.onreadystatechange = function() {
   if (ajaxRequest_nowon.readyState == 4) {
	document.getElementById("loadnowon").innerHTML = ajaxRequest_nowon.responseText;
	addReflections();
   }
	}
    ajaxRequest_nowon.send(null)
	
}

function UpdateNowOnNLFM(){
		var rand2 = Math.random();
   
   ajaxRequest_nowonnlfm.open('GET', 'scripts/smashfm.nowon.nlfm.php?type=now_artist&ajax=1&rand='+rand2+'');
   ajaxRequest_nowonnlfm.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_nowonnlfm.onreadystatechange = function() {
   if (ajaxRequest_nowonnlfm.readyState == 4) {
	document.getElementById("loadnowon2").innerHTML = ajaxRequest_nowonnlfm.responseText;
	addReflections();
   }
	}
    ajaxRequest_nowonnlfm.send(null)
	
}

function UpdateNowOnVISITIT(){
		var rand2 = Math.random();
   
   ajaxRequest_nowonnlfm.open('GET', 'scripts/smashfm.nowon.visitit.php?type=now_artist&ajax=1&rand='+rand2+'');
   ajaxRequest_nowonnlfm.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_nowonnlfm.onreadystatechange = function() {
   if (ajaxRequest_nowonnlfm.readyState == 4) {
	document.getElementById("loadnowon2").innerHTML = ajaxRequest_nowonnlfm.responseText;
	addReflections();
   }
	}
    ajaxRequest_nowonnlfm.send(null)
	
}


function ShowAlbumPic(id){

//sendAjaxGetRequest('components/smashfm.showphoto.php?ajax=1&picid=', 'photoframe');

var rand2 = Math.random();
   
   ajaxRequest_pic.open('GET', 'components/smashfm.showphoto.php?ajax=1&picid='+id+'&rand='+rand2+'');
   ajaxRequest_pic.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajaxRequest_pic.onreadystatechange = function() {
   if (ajaxRequest_pic.readyState == 4) {
	document.getElementById("photoframe").innerHTML = ajaxRequest_pic.responseText;
   }
	}
    ajaxRequest_pic.send(null);

document.getElementById('photoframe').className='show';
document.getElementById('transbackground').className='show';
window.location='#top';
}

function HideAlbumPic(){
document.getElementById('photoframe').className='hide';	
document.getElementById('transbackground').className='hide';
sendAjaxGetRequest('components/smashfm.showphoto.php?ajax=1&picid=', 'photoframe');
}

function LoadMMS(id){
window.open('http://resizer.ringtonio.nl/?clx=1&wres=600&hres=400&rtaff=10489&rtlo=25920&image=http:%2F%2Fwww.smashfm.nl%2Fscripts%2Fsmashfm.watermark.php?file=..%2Fupload%2Fpics%2Fsmashfm.pics.image'+id+'.jpg&bg=&phone=-1','MMSScreen','width=820,height=430,scrollbars=no,toolbar=no,location=no'); 	
}

function ShowSubMenu(value){
document.getElementById(""+value+"_1").className='menu_show_uv';	
document.getElementById(""+value+"_2").className='menu_hide';	
}

function HideSubMenu(value){
document.getElementById(""+value+"_1").className='menu_show';
document.getElementById(""+value+"_2").className='menu_hide_uv';
}

function ShowCommendPreview(formname){
	
	if(formname=='commend'){
	var string = document.commend.message.value.replace(/&nbsp;/, '').replace(/\n/, '<br>');
	} else {
	var string = document.forumpost.message.value.replace(/&nbsp;/, '').replace(/\n/, '<br>');
	}
	
	if(string==""){ document.getElementById("commendpreview").className='hide';	 } else {
	document.getElementById("commendpreview").className='show';
	sendAjaxGetRequest('scripts/smashfm.commendpreview.php?ajax=1&string='+string+'', 'commendpreview');
	}
	
}

function ShowMemberProfilePic(){
document.getElementById('profilephotoframe').className='show';
document.getElementById('transbackground').className='show';
window.location='#top';
}

function HideMemberProfilePic(){
document.getElementById('profilephotoframe').className='hide';
document.getElementById('transbackground').className='hide';
window.location='#top';
}

function Rate(key,keyid,stars){
	
	nd();
	
	if(stars==1){ var rating = 2; }
	if(stars==2){ var rating = 4; }
	if(stars==3){ var rating = 6; }
	if(stars==4){ var rating = 8; }
	if(stars==5){ var rating = 10; }
	
	// ajax
	var RateRequest = initAjaxRequest();
	
    RateRequest.open('POST', 'components/smashfm.rating.php?ajax=1');
	RateRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    RateRequest.onreadystatechange = function() {
		if (RateRequest.readyState == 4 && RateRequest.status == 200) {
			document.getElementById('ratefield').innerHTML = RateRequest.responseText;
		}
	}
	
		
    RateRequest.send('&key='+key+'&keyid='+keyid+'&rating='+rating+'');
	//	
	
}

function ShowStars(id,rating,votes){

if(id==0){
document.getElementById('star1').src='images/smashfm.star.gray.gif';
document.getElementById('star2').src='images/smashfm.star.gray.gif';
document.getElementById('star3').src='images/smashfm.star.gray.gif';
document.getElementById('star4').src='images/smashfm.star.gray.gif';
document.getElementById('star5').src='images/smashfm.star.gray.gif';
nd();
}
if(id==1){
document.getElementById('star1').src='images/smashfm.star.red.gif';
document.getElementById('star2').src='images/smashfm.star.gray.gif';
document.getElementById('star3').src='images/smashfm.star.gray.gif';
document.getElementById('star4').src='images/smashfm.star.gray.gif';
document.getElementById('star5').src='images/smashfm.star.gray.gif';
overlib('Rating: '+rating+' ('+votes+' votes) / Beoordeel dit item met: <b>matig</b>');
}
if(id==2){
document.getElementById('star1').src='images/smashfm.star.red.gif';
document.getElementById('star2').src='images/smashfm.star.red.gif';
document.getElementById('star3').src='images/smashfm.star.gray.gif';
document.getElementById('star4').src='images/smashfm.star.gray.gif';
document.getElementById('star5').src='images/smashfm.star.gray.gif';
overlib('Rating: '+rating+' ('+votes+' votes) / Beoordeel dit item met: <b>redelijk</b>');
}
if(id==3){
document.getElementById('star1').src='images/smashfm.star.red.gif';
document.getElementById('star2').src='images/smashfm.star.red.gif';
document.getElementById('star3').src='images/smashfm.star.red.gif';
document.getElementById('star4').src='images/smashfm.star.gray.gif';
document.getElementById('star5').src='images/smashfm.star.gray.gif';
overlib('Rating: '+rating+' ('+votes+' votes) / Beoordeel dit item met: <b>goed</b>');
}
if(id==4){
document.getElementById('star1').src='images/smashfm.star.red.gif';
document.getElementById('star2').src='images/smashfm.star.red.gif';
document.getElementById('star3').src='images/smashfm.star.red.gif';
document.getElementById('star4').src='images/smashfm.star.red.gif';
document.getElementById('star5').src='images/smashfm.star.gray.gif';
overlib('Rating: '+rating+' ('+votes+' votes) / Beoordeel dit item met: <b>zeer goed</b>');
}
if(id==5){
document.getElementById('star1').src='images/smashfm.star.red.gif';
document.getElementById('star2').src='images/smashfm.star.red.gif';
document.getElementById('star3').src='images/smashfm.star.red.gif';
document.getElementById('star4').src='images/smashfm.star.red.gif';
document.getElementById('star5').src='images/smashfm.star.red.gif';
overlib('Rating: '+rating+' ('+votes+' votes) / Beoordeel dit item met: <b>geweldig!</b>');
}

}

function download(id){

 // Define the name and size:
 var win_title	=	'sendpop';
 var win_width	=	550;
 var win_height	=	457;
 
 // Open the window:
 window.open("http://www.targetmusic.nl/order?id="+id+"&rtlo=25922", ''+win_title+'', 'width='+win_width+', height='+win_height+', toolbar=0, scrollbars=0, location=0, status=0, menubar=0, resizable=0, screenX=' + ((screen.width - win_width) / 2) + ', screenY=' + ((screen.height - win_height) / 2) + ', top=' + ((screen.height - win_height) / 2) + ', left=' + ((screen.width - win_width) / 2) + '');

 }
