function shownhide(id){
  if(document.getElementById(id)){
    var theElement = document.getElementById(id);
    if(theElement.style.display == "none"){
      theElement.style.display = "block";
    }else{
      theElement.style.display = "none";
    }
  }
}
function artist_info(str,str_class,str_col_1,str_col_2,str_col_3,str_col_4){
	var ele_links='artist_links_holder';
	var ele_contact='artist_contact_holder';
	if(str=='links'){
		document.getElementById(ele_links).style.display = "block";
		document.getElementById(ele_contact).style.display = "none";
		document.getElementById('div_artist_info_tab').innerHTML="<div class=\"div_ex_tab_artist float_inline\">"+
"<a href=\"#\" id=\"links_tab_link\" class=\""+str_class+"\" onmouseover=\"relatedTabOver('links_tab_link','"+str_col_2+"');relatedTabOver('artist_links_holder','"+str_col_2+"');\" onmouseout=\"relatedTabOut('links_tab_link','"+str_col_1+"');relatedTabOut('artist_links_holder','"+str_col_1+"');\" onclick=\"artist_info('links','"+str_class+"','"+str_col_1+"','"+str_col_2+"','"+str_col_3+"','"+str_col_4+"');return false;\">"+
"<span class=\"tl\"></span><span class=\"tr\"></span>"+
"Links</a>"+
"</div>"+
"<div class=\"div_ex_tab_related float_inline\">"+
"<a href=\"#\" id=\"contact_tab_link\" class=\"inactive\" onclick=\"artist_info('contact','"+str_class+"','"+str_col_1+"','"+str_col_2+"','"+str_col_3+"','"+str_col_4+"');return false;\">"+
"<span class=\"tl\"></span><span class=\"tr\"></span>"+
"Contact</a>"+
"</div>";
	}else if(str=='contact'){
		document.getElementById(ele_links).style.display = "none";
		document.getElementById(ele_contact).style.display = "block";
		document.getElementById('div_artist_info_tab').innerHTML="<div class=\"div_ex_tab_artist float_inline\">"+
"<a href=\"#\" id=\"links_tab_link\" class=\"inactive\" onclick=\"artist_info('links','"+str_class+"','"+str_col_1+"','"+str_col_2+"','"+str_col_3+"','"+str_col_4+"');return false;\">"+
"<span class=\"tl\"></span><span class=\"tr\"></span>"+
"Links</a>"+
"</div>"+
"<div class=\"div_ex_tab_related float_inline\">"+
"<a href=\"#\" id=\"contact_tab_link\" class=\""+str_class+"\" onmouseover=\"relatedTabOver('contact_tab_link','"+str_col_2+"');relatedTabOver('artist_contact_holder','"+str_col_2+"');\" onmouseout=\"relatedTabOut('contact_tab_link','"+str_col_1+"');relatedTabOut('artist_contact_holder','"+str_col_1+"');\"  onclick=\"artist_info('contact','"+str_class+"','"+str_col_1+"','"+str_col_2+"','"+str_col_3+"','"+str_col_4+"');return false;\">"+
"<span class=\"tl\"></span><span class=\"tr\"></span>"+
"Contact</a>"+
"</div>";
	}
}
// main function to process the fade request //
function colorFade(id,element,start,end,steps,speed) {
  var startrgb,endrgb,er,eg,eb,step,rint,gint,bint,step;
  var target = document.getElementById(id);
  steps = steps || 20;
  speed = speed || 20;
  clearInterval(target.timer);
  endrgb = colorConv(end);
  er = endrgb[0];
  eg = endrgb[1];
  eb = endrgb[2];
  if(!target.r) {
    startrgb = colorConv(start);
    r = startrgb[0];
    g = startrgb[1];
    b = startrgb[2];
    target.r = r;
    target.g = g;
    target.b = b;
  }
  rint = Math.round(Math.abs(target.r-er)/steps);
  gint = Math.round(Math.abs(target.g-eg)/steps);
  bint = Math.round(Math.abs(target.b-eb)/steps);
  if(rint == 0) { rint = 1 }
  if(gint == 0) { gint = 1 }
  if(bint == 0) { bint = 1 }
  target.step = 1;
  target.timer = setInterval( function() { animateColor(id,element,steps,er,eg,eb,rint,gint,bint) }, speed);
}

// incrementally close the gap between the two colors //
function animateColor(id,element,steps,er,eg,eb,rint,gint,bint) {
  var target = document.getElementById(id);
  var color;
  if(target.step <= steps) {
    var r = target.r;
    var g = target.g;
    var b = target.b;
    if(r >= er) {
      r = r - rint;
    } else {
      r = parseInt(r) + parseInt(rint);
    }
    if(g >= eg) {
      g = g - gint;
    } else {
      g = parseInt(g) + parseInt(gint);
    }
    if(b >= eb) {
      b = b - bint;
    } else {
      b = parseInt(b) + parseInt(bint);
    }
    color = 'rgb(' + r + ',' + g + ',' + b + ')';
    if(element == 'background') {
      target.style.backgroundColor = color;
    } else if(element == 'border') {
      target.style.borderColor = color;
    } else {
      target.style.color = color;
    }
    target.r = r;
    target.g = g;
    target.b = b;
    target.step = target.step + 1;
  } else {
    clearInterval(target.timer);
    color = 'rgb(' + er + ',' + eg + ',' + eb + ')';
    if(element == 'background') {
      target.style.backgroundColor = color;
    } else if(element == 'border') {
      target.style.borderColor = color;
    } else {
      target.style.color = color;
    }
  }
}

// convert the color to rgb from hex //
function colorConv(color) {
  var rgb = [parseInt(color.substring(0,2),16), 
    parseInt(color.substring(2,4),16), 
    parseInt(color.substring(4,6),16)];
  return rgb;
}


function at_show_aux(parent, child)
{
 var p = document.getElementById(parent);
 var c = document.getElementById(child );

 var top  = (c["at_position"] == "y") ? p.offsetHeight : 0;
 var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

 for (; p; p = p.offsetParent)
 {
   top  += p.offsetTop;
   left += p.offsetLeft;
 }
 if(parent=="regions"){ left=left-176; }

 c.style.position   = "absolute";
 c.style.top        = top +'px';
 c.style.left       = left+'px';
 c.style.visibility = "visible";
 c.style.zIndex = "999";
}
// ***** at_show *****

function at_show()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  fnc_parent_hover_over(this["at_parent"]);

  at_show_aux(p.id, c.id);
  clearTimeout(c["at_timeout"]);
}

// ***** at_hide *****

function at_hide()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);
  
  fnc_parent_hover_out(this["at_parent"]);

  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 0);
}

// ***** at_click *****

function at_click()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  if (c.style.visibility != "visible") at_show_aux(p.id, c.id); else c.style.visibility = "hidden";
  return false;
}

// ***** at_attach *****

// PARAMETERS:
// parent   - id of the parent html element
// child    - id of the child  html element that should be droped down
// showtype - "click" = drop down child html element on mouse click
//            "hover" = drop down child html element on mouse over
// position - "x" = display the child html element to the right
//            "y" = display the child html element below
// cursor   - omit to use default cursor or specify CSS cursor name

function at_attach(parent, child, showtype, position, cursor)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;

  c.style.position   = "absolute";
  c.style.visibility = "hidden";

  if (cursor != undefined) p.style.cursor = cursor;

  switch (showtype)
  {
    case "click":
      p.onclick     = at_click;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
    case "hover":
      p.onmouseover = at_show;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
  }
}

function rollOverMap(x,y){
	var ele=document.getElementById('div_map');
	ele.style.backgroundPosition=x+'px '+y+'px';
}
function rollOutMap(x,y){
	var ele=document.getElementById('div_map');
	ele.style.backgroundPosition=x+'px '+y+'px';
}
function showrecords(ele){
		if(ele=="1"){
			document.getElementById('records_list_'+ele).style.display='block';
			document.getElementById('records_list_2').style.display='none';
			document.getElementById('records_list_3').style.display='none';
			document.getElementById('current_records').style.left='24px';
		}else if(ele=="2"){
			document.getElementById('records_list_'+ele).style.display='block';
			document.getElementById('records_list_1').style.display='none';
			document.getElementById('records_list_3').style.display='none';
			document.getElementById('current_records').style.left='103px';
		}else if(ele=="3"){
			document.getElementById('records_list_'+ele).style.display='block';
			document.getElementById('records_list_1').style.display='none';
			document.getElementById('records_list_2').style.display='none';
			document.getElementById('current_records').style.left='183px';
		}
}
function showfilms(ele){
		if(ele=="1"){
			document.getElementById('films_list_'+ele).style.display='block';
			document.getElementById('films_list_2').style.display='none';
			document.getElementById('films_list_3').style.display='none';
			document.getElementById('current_films').style.left='81px';
		}else if(ele=="2"){
			document.getElementById('films_list_'+ele).style.display='block';
			document.getElementById('films_list_1').style.display='none';
			document.getElementById('films_list_3').style.display='none';
			document.getElementById('current_films').style.left='223px';
		}else if(ele=="3"){
			document.getElementById('films_list_'+ele).style.display='block';
			document.getElementById('films_list_1').style.display='none';
			document.getElementById('films_list_2').style.display='none';
			document.getElementById('current_films').style.left='333px';
		}
}
function news_feed(int_page,str_type,int_limit,int_division,int_region,int_artist,int_news){
	var ajaxRequest;  // The variable that makes Ajax possible!
		 try{
		   // Opera 8.0+, Firefox, Safari
		   ajaxRequest = new XMLHttpRequest();
		  // alert('Opera 8.0+, Firefox, Safari');
		 }catch (e){
		   // Internet Explorer Browsers
		   try{
			  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			  //alert('Msxml2.XMLHTTP');
		   }catch (e) {
			  try{
				 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				 //alert('Microsoft.XMLHTTP');
			  }catch (e){
				 // Something went wrong
				 alert("Your browser broke!");
				 return false;
			  }
		   }
		 }
		 // Create a function that will receive data 
		 // sent from the server and will update
		 // div section in the same page.
		 ajaxRequest.onreadystatechange = function(){
		 //alert(ajaxRequest.readyState);
		   if(ajaxRequest.readyState == 4){
			   if(ajaxRequest.status  == 200) {
					  // ajaxDisplay.innerHTML = ajaxRequest.responseText;
					  //alert(ajaxRequest.responseText);
					  if(str_type=="homepage_news"){
						  document.getElementById('home_news_feed_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('home_news_feed_item_holder').style.height='auto';
					  }else if(str_type=="artist_news"){
						  //news_feed_news_artist_x3_holder
						 // news_feed_news_artist_x3_item_holder
						 document.getElementById('news_feed_news_artist_x3_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('news_feed_news_artist_x3_item_holder').style.height='auto';
					  }else if(str_type=="artistpage_news"){
						  //news_feed_news_artist_x3_holder
						 // news_feed_news_artist_x3_item_holder
						 document.getElementById('artist_news_feed_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('artist_news_feed_item_holder').style.height='auto';
					  }else if(str_type=="related_artist_news"){
						  //news_feed_news_artist_x3_holder
						 // news_feed_news_artist_x3_item_holder
						 document.getElementById('news_feed_news_x3_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('news_feed_news_x3_item_holder').style.height='auto';
					  }else if(str_type=="eventspage_artist_news" || str_type=="eventspage_artist_related_news"){
						  //news_feed_news_artist_x3_holder
						 // news_feed_news_artist_x3_item_holder
						 document.getElementById('events_artist_feed_news_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('events_artist_feed_news_item_holder').style.height='auto';
					  }
					  }else {
					   ajaxDisplay.innerHTML = ajaxRequest.status;
						//document.ajax.dyn="Error code " + xhr.status;
				 }
		   }
		 }
		 if(str_type=="homepage_news"){
			var int_holder_height = document.getElementById('home_news_feed_item_holder').offsetHeight;
			document.getElementById('home_news_feed_item_holder').style.height=int_holder_height+'px';
			document.getElementById('home_news_feed_item_holder').innerHTML='<div class="div_news_item wg_clr_bg sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=="artist_news"){
			 var int_holder_height = document.getElementById('news_feed_news_artist_x3_item_holder').offsetHeight;
		document.getElementById('news_feed_news_artist_x3_item_holder').style.height=int_holder_height+'px';
		document.getElementById('news_feed_news_artist_x3_item_holder').innerHTML='<div class="div_news_item wg_clr_bg sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=="artistpage_news"){
			 var int_holder_height = document.getElementById('artist_news_feed_item_holder').offsetHeight;
		document.getElementById('artist_news_feed_item_holder').style.height=int_holder_height+'px';
		document.getElementById('artist_news_feed_item_holder').innerHTML='<div class="div_news_item wg_clr_bg sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=="related_artist_news"){
			 var int_holder_height = document.getElementById('news_feed_news_x3_item_holder').offsetHeight;
		document.getElementById('news_feed_news_x3_item_holder').style.height=int_holder_height+'px';
		document.getElementById('news_feed_news_x3_item_holder').innerHTML='<div class="div_news_item wg_clr_bg sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=="eventspage_artist_news" || str_type=="eventspage_artist_related_news"){
			 var int_holder_height = document.getElementById('events_artist_feed_news_item_holder').offsetHeight;
		document.getElementById('events_artist_feed_news_item_holder').style.height=int_holder_height+'px';
		document.getElementById('events_artist_feed_news_item_holder').innerHTML='<div class="div_news_item wg_clr_bg sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';
		 }
		ajaxRequest.open("GET", "/scr/news_feed.php?int_page="+int_page+"&str_type="+str_type+"&int_limit="+int_limit+"&int_division="+int_division+"&int_region="+int_region+"&int_artist="+int_artist+"&int_news="+int_news, true);
 		ajaxRequest.send(null);
}
function releases_feed(int_page,str_type,int_limit,int_division,int_region,int_artist,int_release,bln_playlist){
	var ajaxRequest;  // The variable that makes Ajax possible!
		 try{
		   // Opera 8.0+, Firefox, Safari
		   ajaxRequest = new XMLHttpRequest();
		  // alert('Opera 8.0+, Firefox, Safari');
		 }catch (e){
		   // Internet Explorer Browsers
		   try{
			  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			  //alert('Msxml2.XMLHTTP');
		   }catch (e) {
			  try{
				 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				 //alert('Microsoft.XMLHTTP');
			  }catch (e){
				 // Something went wrong
				 alert("Your browser broke!");
				 return false;
			  }
		   }
		 }
		 // Create a function that will receive data 
		 // sent from the server and will update
		 // div section in the same page.
		 ajaxRequest.onreadystatechange = function(){
		 //alert(ajaxRequest.readyState);
		   if(ajaxRequest.readyState == 4){
			   if(ajaxRequest.status  == 200) {
					  // ajaxDisplay.innerHTML = ajaxRequest.responseText;
					  //alert(ajaxRequest.responseText);
					  if(str_type=="homepage_releases"){
						  document.getElementById('home_releases_feed_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('home_releases_feed_item_holder').style.height='auto';
					  }else if(str_type=="artist_releases"){
						  	document.getElementById('artist_feed_releases_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('artist_feed_releases_item_holder').style.height='auto';
					  }
					  else if(str_type=="related_artist_releases"){
						  	document.getElementById('related_artist_releases_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('related_artist_releases_item_holder').style.height='auto';
					  }
					  else if(str_type=="eventspage_artist_releases" || str_type=="eventspage_related_artist_releases"){
						  	document.getElementById('events_artist_feed_holder').innerHTML=ajaxRequest.responseText;
						  document.getElementById('events_artist_feed_item_holder').style.height='auto';
					  }
					  reInitPlayer();
					  }else {
					   ajaxDisplay.innerHTML = ajaxRequest.status;
						//document.ajax.dyn="Error code " + xhr.status;
				 }
		   }
		 }
		 if(str_type=="homepage_releases"){
			var int_holder_height = document.getElementById('home_releases_feed_item_holder').offsetHeight;
			document.getElementById('home_releases_feed_item_holder').style.height=int_holder_height+'px';
			document.getElementById('home_releases_feed_item_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=="artist_releases"){
			 	var int_holder_height = document.getElementById('artist_feed_releases_item_holder').offsetHeight;
			document.getElementById('artist_feed_releases_item_holder').style.height=int_holder_height+'px';
			document.getElementById('artist_feed_releases_item_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=="related_artist_releases"){
			 	var int_holder_height = document.getElementById('related_artist_releases_item_holder').offsetHeight;
				//alert('height = '+int_holder_height);
			document.getElementById('related_artist_releases_item_holder').style.height=int_holder_height+'px';
			document.getElementById('related_artist_releases_item_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=="eventspage_artist_releases" || str_type=="eventspage_related_artist_releases"){
			 	var int_holder_height = document.getElementById('events_artist_feed_item_holder').offsetHeight;
			document.getElementById('events_artist_feed_item_holder').style.height=int_holder_height+'px';
			document.getElementById('events_artist_feed_item_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }
		ajaxRequest.open("GET", "/scr/releases_feed.php?int_page="+int_page+"&str_type="+str_type+"&int_limit="+int_limit+"&int_division="+int_division+"&int_region="+int_region+"&int_artist="+int_artist+"&int_release="+int_release+"&bln_playlist="+bln_playlist, true);
 		ajaxRequest.send(null);
}
function playlist_feed(int_page,str_type,int_limit,int_division,int_region,int_id,int_playlist,bln_master_feed){
	var ajaxRequest;  // The variable that makes Ajax possible!
		 try{
		   // Opera 8.0+, Firefox, Safari
		   ajaxRequest = new XMLHttpRequest();
		  // alert('Opera 8.0+, Firefox, Safari');
		 }catch (e){
		   // Internet Explorer Browsers
		   try{
			  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			  //alert('Msxml2.XMLHTTP');
		   }catch (e) {
			  try{
				 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				 //alert('Microsoft.XMLHTTP');
			  }catch (e){
				 // Something went wrong
				 alert("Your browser broke!");
				 return false;
			  }
		   }
		 }
		 // Create a function that will receive data 
		 // sent from the server and will update
		 // div section in the same page.
		 ajaxRequest.onreadystatechange = function(){
		 //alert(ajaxRequest.readyState);
		   if(ajaxRequest.readyState == 4){
			   if(ajaxRequest.status  == 200) {
					  // ajaxDisplay.innerHTML = ajaxRequest.responseText;
					  //alert(ajaxRequest.responseText);
						document.getElementById('media_playlist_holder').innerHTML=ajaxRequest.responseText;
						 //document.getElementById('media_playlist_item_holder').style.height='auto';
					  }else {
					   ajaxDisplay.innerHTML = ajaxRequest.status;
						//document.ajax.dyn="Error code " + xhr.status;
				 }
		   }
		 }
		var int_holder_height = document.getElementById('media_playlist_item_holder').offsetHeight;
		document.getElementById('media_playlist_item_holder').style.height=int_holder_height+'px';
		document.getElementById('media_playlist_item_holder').innerHTML='<div class="r_item b_clr_bg float_inline sml_tltrblbr loader_black" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';

		ajaxRequest.open("GET", "/scr/playlist_feed.php?int_page="+int_page+"&str_type="+str_type+"&int_limit="+int_limit+"&int_division="+int_division+"&int_region="+int_region+"&int_id="+int_id+"&int_playlist="+int_playlist+"&bln_master_feed="+bln_master_feed, true);
 		ajaxRequest.send(null);
}
function explore_feed(int_page,str_type,int_limit,int_division,int_region,int_id,bln_master_feed){
	var ajaxRequest;  // The variable that makes Ajax possible!
		 try{
		   // Opera 8.0+, Firefox, Safari
		   ajaxRequest = new XMLHttpRequest();
		  // alert('Opera 8.0+, Firefox, Safari');
		 }catch (e){
		   // Internet Explorer Browsers
		   try{
			  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			  //alert('Msxml2.XMLHTTP');
		   }catch (e) {
			  try{
				 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				 //alert('Microsoft.XMLHTTP');
			  }catch (e){
				 // Something went wrong
				 alert("Your browser broke!");
				 return false;
			  }
		   }
		 }
		 // Create a function that will receive data 
		 // sent from the server and will update
		 // div section in the same page.
		 ajaxRequest.onreadystatechange = function(){
		 //alert(ajaxRequest.readyState);
		   if(ajaxRequest.readyState == 4){
			   if(ajaxRequest.status  == 200) {
					  // ajaxDisplay.innerHTML = ajaxRequest.responseText;
					  //alert(ajaxRequest.responseText);
						document.getElementById('explore_holder').innerHTML=ajaxRequest.responseText;
						//document.getElementById('explore_item_holder').style.height='auto';
					  }else {
					   ajaxDisplay.innerHTML = ajaxRequest.status;
						//document.ajax.dyn="Error code " + xhr.status;
				 }
		   }
		 }
		 var int_holder_height = document.getElementById('explore_item_holder').offsetHeight;
		document.getElementById('explore_item_holder').style.height=int_holder_height+'px';
		document.getElementById('explore_holder').innerHTML='<div class="r_item b_clr_bg float_inline sml_tltrblbr loader_black" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';
		
		ajaxRequest.open("GET", "/scr/explore_feed.php?int_page="+int_page+"&str_type="+str_type+"&int_limit="+int_limit+"&int_division="+int_division+"&int_region="+int_region+"&int_id="+int_id+"&bln_master_feed="+bln_master_feed, true);
 		ajaxRequest.send(null);
}
function events_feed(int_page, str_type,int_limit,int_division,int_region,int_artist,int_year,int_month,int_day,int_country,int_event){
	var ajaxRequest;  // The variable that makes Ajax possible!
		 try{
		   // Opera 8.0+, Firefox, Safari
		   ajaxRequest = new XMLHttpRequest();
		  // alert('Opera 8.0+, Firefox, Safari');
		 }catch (e){
		   // Internet Explorer Browsers
		   try{
			  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			  //alert('Msxml2.XMLHTTP');
		   }catch (e) {
			  try{
				 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				 //alert('Microsoft.XMLHTTP');
			  }catch (e){
				 // Something went wrong
				 alert("Your browser broke!");
				 return false;
			  }
		   }
		 }
		 // Create a function that will receive data 
		 // sent from the server and will update
		 // div section in the same page.
		 ajaxRequest.onreadystatechange = function(){
		 //alert(ajaxRequest.readyState);
		   if(ajaxRequest.readyState == 4){
			   if(ajaxRequest.status  == 200) {
					  // ajaxDisplay.innerHTML = ajaxRequest.responseText;
					 //alert(ajaxRequest.responseText);
						  if(str_type=='relatedartists_events'){
							document.getElementById('events_related_holder').innerHTML=ajaxRequest.responseText;
							document.getElementById('events_related_item_holder').style.height='auto';
						  }else if(str_type=='homepage_events'){
						  	document.getElementById('homepage_events_holder').innerHTML=ajaxRequest.responseText;
							document.getElementById('homepage_events_item_holder').style.height='auto';
						  }else if(str_type=='artistprofilepage_events'){
						  	document.getElementById('artistprofilepage_events_holder').innerHTML=ajaxRequest.responseText;
							document.getElementById('artistprofilepage_events_item_holder').style.height='auto';
						  }else if(str_type=='artistprofilepage_related_events'){
						  	document.getElementById('artistprofilepage_related_events_holder').innerHTML=ajaxRequest.responseText;
							document.getElementById('artistprofilepage_related_events_item_holder').style.height='auto';
						  }else{
							document.getElementById('events_holder').innerHTML=ajaxRequest.responseText;
							document.getElementById('events_item_holder').style.height='auto';
						  }
					  }else {
					   ajaxDisplay.innerHTML = ajaxRequest.status;
						//document.ajax.dyn="Error code " + xhr.status;
				 }
		   }
		 }
		 if(str_type=='relatedartists_events'){
			 var int_holder_height = document.getElementById('events_related_item_holder').offsetHeight+30;
			document.getElementById('events_related_item_holder').style.height=int_holder_height+'px';
			document.getElementById('events_related_item_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;width:236px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=='homepage_events'){
			 var int_holder_height = document.getElementById('homepage_events_item_holder').offsetHeight+30;
			document.getElementById('homepage_events_item_holder').style.height=int_holder_height+'px';
			document.getElementById('homepage_events_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;width:236px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=='artistprofilepage_events'){
			 var int_holder_height = document.getElementById('artistprofilepage_events_item_holder').offsetHeight+30;
			document.getElementById('artistprofilepage_events_item_holder').style.height=int_holder_height+'px';
			document.getElementById('artistprofilepage_events_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;width:236px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }else if(str_type=='artistprofilepage_related_events'){
			 var int_holder_height = document.getElementById('artistprofilepage_related_events_item_holder').offsetHeight+30;
			document.getElementById('artistprofilepage_related_events_item_holder').style.height=int_holder_height+'px';
			document.getElementById('artistprofilepage_related_events_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;width:236px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:236px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }else{
			var int_holder_height = document.getElementById('events_item_holder').offsetHeight;
			document.getElementById('events_item_holder').style.height=int_holder_height+'px';
			document.getElementById('events_holder').innerHTML='<div class="r_item wg_clr_bg float_inline sml_tltrblbr loader_grey" style="height:'+int_holder_height+'px;width:968px;" /><div class="tl"></div><div class="tr"></div><div class="clear_both" style="width:968px;">&nbsp;</div><div class="bl"></div><div class="br"></div></div>';
		 }
		 
		 if(document.getElementById('dateorder')){
		 	var str_dateorder=document.getElementById('dateorder').value;
		 }else{
			 var str_dateorder="ASC";
		 }
		ajaxRequest.open("GET", "/scr/events_feed.php?int_page="+int_page+"&str_type="+str_type+"&int_limit="+int_limit+"&int_division="+int_division+"&int_region="+int_region+"&int_artist="+int_artist+"&int_year="+int_year+"&int_month="+int_month+"&int_day="+int_day+"&int_country="+int_country+"&int_event="+int_event+"&str_dateorder="+str_dateorder, true);
 		ajaxRequest.send(null);
}
function calendar_feed(dat_date,int_month,int_year,int_day,int_division,int_artist,int_country, str_date_url){
	var ajaxRequest;  // The variable that makes Ajax possible!
		 try{
		   // Opera 8.0+, Firefox, Safari
		   ajaxRequest = new XMLHttpRequest();
		  // alert('Opera 8.0+, Firefox, Safari');
		 }catch (e){
		   // Internet Explorer Browsers
		   try{
			  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			  //alert('Msxml2.XMLHTTP');
		   }catch (e) {
			  try{
				 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				 //alert('Microsoft.XMLHTTP');
			  }catch (e){
				 // Something went wrong
				 alert("Your browser broke!");
				 return false;
			  }
		   }
		 }
		 // Create a function that will receive data 
		 // sent from the server and will update
		 // div section in the same page.
		 ajaxRequest.onreadystatechange = function(){
		 //alert(ajaxRequest.readyState);
		   if(ajaxRequest.readyState == 4){
			   if(ajaxRequest.status  == 200) {
					  // ajaxDisplay.innerHTML = ajaxRequest.responseText;
					  //alert(ajaxRequest.responseText);
						document.getElementById('calendar_holder').innerHTML=ajaxRequest.responseText;
						//document.getElementById('explore_item_holder').style.height='auto';
					  }else {
					   ajaxDisplay.innerHTML = ajaxRequest.status;
						//document.ajax.dyn="Error code " + xhr.status;
				 }
		   }
		 }
		// var int_holder_height = document.getElementById('explore_item_holder').offsetHeight;
		//document.getElementById('explore_item_holder').style.height=int_holder_height+'px';
		//document.getElementById('explore_holder').innerHTML='<div class="r_item b_clr_bg float_inline sml_tltrblbr loader" style="height:'+int_holder_height+'px;" /><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>';
		
		ajaxRequest.open("GET", "/scr/calendar_feed.php?dat_date="+dat_date+"&int_month="+int_month+"&int_year="+int_year+"&int_day="+int_day+"&int_division="+int_division+"&int_artist="+int_artist+"&int_country="+int_country+"&str_date_url="+str_date_url, true);
 		ajaxRequest.send(null);
}
function dropDownMenu(str_link){
	 if(str_link!=''){ self.location.href=str_link; }
}
function updateMediaTitle(str){
	document.getElementById('media_player_title').innerHTML=str;
}
function relatedTabOver(ele,str_colour){
		document.getElementById(ele).style.backgroundColor='#'+str_colour;
		document.getElementById(ele).style.color='#FFF';
}
function relatedTabOut(ele,str_colour){
		document.getElementById(ele).style.backgroundColor='#'+str_colour;
		document.getElementById(ele).style.color='#515151';
}

function updatedateorder(){
	if(document.getElementById('dateorder').value=="ASC"){
		document.getElementById('dateorder').value="DESC";
		document.getElementById('datesorter_link').className="date_down wg_w";
	}else if(document.getElementById('dateorder').value=="DESC"){
		document.getElementById('dateorder').value="ASC";
		document.getElementById('datesorter_link').className="date_up wg_w";
	}
}