function start(){

//extract query string
var q = document.location.search; 
var q = q.split("?");
var q = q[1];
if(q){
var q2 = q.split("=");
var remote_id = parseInt(q2[1]); //convert string to int
var t ="artist_"+remote_id; 
} // end check if query


new Ajax.Request('scripts/aj_artistmenu.php', {
  method: 'post', 
  onSuccess: function(transport) {
  var z = transport.responseText;
  var zz = z.split("|||");
  
  $('menu2').update(zz[1]);
  if (remote_id) { 
  selectartist(remote_id);
  } else {
    selectartist(zz[0]);
  }
  
  }
  });
  

}





function selectartist(artistID){
if($('subcontent'))$('subcontent').update("");
$$('div.selected_artist').invoke('removeClassName','selected_artist');

var c = "artist_"+artistID;
var selectedDIV=$(c);

selectedDIV.addClassName('selected_artist');

new Ajax.Request('scripts/aj_artistsubmenu.php', {
  method: 'post', parameters : { artistID: artistID },
  onSuccess: function(transport) {
  var z = transport.responseText;
  $('headcontent').update(z);
  if (remote_id) { 
  selectartist(remote_id);
  }
  
  }
  });

}



function getcontent(what,artistID) { 

$$('span.selected_menu').invoke('removeClassName','selected_menu');
var v = "menu_"+what;
var rel = $(v);
rel.addClassName('selected_menu');

new Ajax.Request('scripts/aj_artistcontent.php', {
  method: 'post', parameters : { sel_content: what, artist_id: artistID },
  onSuccess: function(transport) {
  var z = transport.responseText;
 
 $('subcontent').update(z);
  if (remote_id) {  selectartist(remote_id); }
  
  }
  });
}






function nextImage(){
if(z[bilder+4]) bilder = bilder + 4;
else bilder = 0;

$("phototitle").update(z[bilder]+"<br />"+z[bilder+1]);
$("photocredit").update(z[bilder+2]);
$("photo").update(z[bilder+3]);
}

bilder = 0;

function getcontentimages(what,artistID) { 
$('subcontent').innerHTML="<br /><table border='0' width='478' cellspacing='0' cellpadding='0'><tr><td><br /><\/td><td style='text-align:right;'><br /><a href='javascript:void(0)' onclick='nextImage()'><img src='img/static/arrow_right.gif' alt='next picture' width='13' height='15' border='0' /><\/a><\/td><\/tr><tr><td colspan='2' id='photo'> <\/td><\/tr><tr><td id='phototitle'><\/td><td id='photocredit' style='text-align:right;'><\/td><\/tr><\/table>";


$$('span.selected_menu').invoke('removeClassName','selected_menu');
var v = "menu_"+what;
var rel = $(v);
rel.addClassName('selected_menu');

new Ajax.Request('scripts/aj_artistcontent.php', {
  method: 'post', parameters : { sel_content: what, artist_id: artistID },
  onSuccess: function(transport) {
 
z = transport.responseText.evalJSON();

$("phototitle").update(z[0]+"<br />"+z[1]);
$("photocredit").update(z[2]);
$("photo").update(z[3]);


if (remote_id) {  selectartist(remote_id); }

return z;  
  }
  });

}



