var sessCaptcha;
function getCaptcha() {
	getCode();
}
function sendMail() {
	var email = document.getElementById('inputEmail').value;
	if (checkEmail(email)) {
		ajaxSendMail("sendMail.php?inputEmail=" + email);
		document.getElementById("areaNewsletter").innerHTML = "<div id='newslThanks'>Thanks for signing up!</div>";
	}
	else {
		alert("Please enter a valid email address");
		document.getElementById('inputEmail').select();
		document.getElementById('inputEmail').focus();
	}
}
function sendContact() {
	var email = document.getElementById('contactEmail').value;
	var firstName = document.getElementById('contactFirstName').value;
	var lastName = document.getElementById('contactLastName').value;
	var captchaCode = document.getElementById('captcha_code').value;
	if (email == '' || firstName == '' || lastName == '') {
		document.getElementById('contactError').innerHTML = "Please enter all mandatory fields";
		document.getElementById('contactError').style.display='block';
		return;
	}
	var country = document.getElementById('contactCountry').value;
	if (!checkEmail(email)) {
		document.getElementById('contactError').innerHTML = "Please enter a valid email address";
		document.getElementById('contactError').style.display='block';
		document.getElementById('contactEmail').select();
		document.getElementById('contactEmail').focus();
		return;
	}
	if (captchaCode != sessCaptcha) {
		document.getElementById('contactError').innerHTML = "Security code is wrong";
		document.getElementById('contactError').style.display='block';
		document.getElementById('captcha_code').select();
		document.getElementById('captcha_code').focus();
		return;
	}
	
	document.getElementById('contactError').style.display='none';
	var subscription = "no";
	if (document.getElementById('contactSubs').value == 'on') {
		subscription = "yes";
	}
	ajaxSendMail("sendContact.php?contactEmail=" + email + "&contactTitle=" + document.getElementById('contactTitle').value + "&contactFirstName=" + firstName + "&contactLastName=" + lastName + "&contactCountry=" + country + "&contactTel=" + document.getElementById('contactTel').value + "&contactSubs=" + subscription + "&contactMsg=" + escape(document.getElementById('contactMsg').value));
	document.getElementById("centerAllContact").innerHTML = "<div id='contactThanks'>Thanks for your message!</div>";
}
function nav(str) {
	switch(str) {
		case 'news':
			ajaxFunction("news/news.html", "centerAll");
			break;
		case 'artists01':
			ajaxFunction("artists/artists01.html", "centerAll");
			break;
		case 'artists02':
			ajaxFunction("artists/artists02.html", "centerAll");
			break;
		case 'artAlexMind':
			ajaxFunction("artists/artAlexMind.html", "centerAll");
			break;
		case 'artAuto':
			ajaxFunction("artists/artistsAuto.html", "centerAll");
			break;
		case 'artColdblank':
			ajaxFunction("artists/artistsColdblank.html", "centerAll");
			break;
		case 'artCostello':
			ajaxFunction("artists/artistsCostello.html", "centerAll");
			break;
		case 'artDaFresh':
			ajaxFunction("artists/artDaFresh.html", "centerAll");
			break;
		case 'artDanTh':
			ajaxFunction("artists/artDanTh.html", "centerAll");
			break;
		case 'artDefunct':
			ajaxFunction("artists/artistsDefunct.html", "centerAll");
			break;
		case 'artDirtyFreak':
			ajaxFunction("artists/artistsDirtyFreak.html", "centerAll");
			break;
		case 'artElSoul':
			ajaxFunction("artists/artistsElSoul.html", "centerAll");
			break;
		case 'artElectr':
			ajaxFunction("artists/artistsElectrixx.html", "centerAll");
			break;
		case 'artIdBOyzZ':
			ajaxFunction("artists/artIdBOyzZ.html", "centerAll");
			break;
		case 'artJakesh':
			ajaxFunction("artists/artistsJakeSh.html", "centerAll");
			break;
		case 'artJelo':
			ajaxFunction("artists/artistsJelo.html", "centerAll");
			break;
		case 'artHirshee':
			ajaxFunction("artists/artistsHirshee.html", "centerAll");
			break;
		case 'artKelevra':
			ajaxFunction("artists/artistsKelevra.html", "centerAll");
			break;
		case 'artLazyRich':
			ajaxFunction("artists/artistsLazyRich.html", "centerAll");
			break;
		case 'artLuigi':
			ajaxFunction("artists/artistsLuigi.html", "centerAll");
			break;
		case 'artMarquez':
			ajaxFunction("artists/artistsMarquez.html", "centerAll");
			break;
		case 'artMonolythe':
			ajaxFunction("artists/artistsMonolythe.html", "centerAll");
			break;
		case 'artPhat':
			ajaxFunction("artists/artistsPhat.html", "centerAll");
			break;
		case 'artQuaver':
			ajaxFunction("artists/artistsQuaver.html", "centerAll");
			break;
		case 'artRadioJack':
			ajaxFunction("artists/artistsRadioJack.html", "centerAll");
			break;
		case 'artRoyRose':
			ajaxFunction("artists/artRoyRose.html", "centerAll");
			break;
		case 'artTomEQ':
			ajaxFunction("artists/artistsTomEQ.html", "centerAll");
			break;
		case 'cdComp':
			ajaxFunction("cdcomp/cdComp.html", "centerAll");
			break;
		case 'releases':
			ajaxFunction("releases/releases.html", "centerAll");
			break;
		case 'relSiberia':
			ajaxFunction("releases/relSiberia.html", "centerAll");
			break;
		case 'relBreakIt':
			ajaxFunction("releases/relBreakIt.html", "centerAll");
			break;
		case 'relBreakItRem':
			ajaxFunction("releases/relBreakItRem.html", "centerAll");
			break;
		case 'relTheMove':
			ajaxFunction("releases/relTheMove.html", "centerAll");
			break;
		case 'relHitOn':
			ajaxFunction("releases/relHitOn.html", "centerAll");
			break;
		case 'relMinusPlus':
			ajaxFunction("releases/relMinusPlus.html", "centerAll");
			break;
		case 'relRuins':
			ajaxFunction("releases/relRuins.html", "centerAll");
			break;
		case 'relHitOnRem':
			ajaxFunction("releases/relHitOnRem.html", "centerAll");
			break;
		case 'about': 
			ajaxFunction("about.html", "centerAll");
			break;
		case 'contact': 
			ajaxFunction("contact.html", "centerAll");
			break;
		case 'radio': 
			ajaxFunction("radio/radio.html", "centerAll");
			break;
		case 'goodies': 
			ajaxFunction("goodies/goodies.html", "centerAll");
			break;
		case 'merch': 
			ajaxFunction("merch/merch.html", "centerAll");
			break;
		case 'demoSubm': 
			ajaxFunction("demo/demo.html", "centerAll");
			break;
		case 'tv': 
			ajaxFunction("tv/tv.html", "centerAll");
			break;
	}
}
function radioEp() {
	var currentEp = document.getElementById("currentEp").value;
	document.getElementById(currentEp).style.display = "none";
	var toShow = document.getElementById('radioSelect').value;
	document.getElementById(toShow).style.display = "block";
	document.getElementById("currentEp").value = toShow;
}
function ajaxFunction(source, area)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  //document.myForm.time.value=xmlhttp.responseText;
  document.getElementById(area).innerHTML = xmlhttp.responseText;
  }
}
xmlhttp.open("GET",source,true);
xmlhttp.send(null);
}

function ajaxSendMail(source)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.open("GET",source,true);
xmlhttp.send(null);
}

function checkEmail(email) {
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email)) {
		return false;
	}
	return true;
}

function checkCaptcha(captchaCode) {
 var xmlhttp;
 if (window.XMLHttpRequest) {
  xmlhttp=new XMLHttpRequest();
 }
 else if (window.ActiveXObject) {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
 }
 else {
  alert("Your browser does not support XMLHTTP!");
 }
 xmlhttp.onreadystatechange=function() {
 if(xmlhttp.readyState==4) {
  alert(xmlhttp.responseText);
  return xmlhttp.responseText;
 }
 }
 xmlhttp.open("GET","checkCaptcha.php?code=" + captchaCode,true);
 xmlhttp.send(null);
}

function getCode() {
 var xmlhttp;
 if (window.XMLHttpRequest) {
  xmlhttp=new XMLHttpRequest();
 }
 else if (window.ActiveXObject) {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
 }
 else {
  alert("Your browser does not support XMLHTTP!");
 }
 xmlhttp.onreadystatechange=function() {
 if(xmlhttp.readyState==4) {
  sessCaptcha = xmlhttp.responseText;
 }
 }
 xmlhttp.open("GET","checkCaptcha.php",true);
 xmlhttp.send(null);
}
      
/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimages=new Array()
fadeimages[0]=["images/banners/banner01.jpg", "http://www.amazon.com/Big-Floor-Destroyers-Vol-1/dp/B003ANQGVG/", "_new"]
fadeimages[1]=["images/banners/banner02.jpg", "javascript:nav('radio');", ""]
fadeimages[2]=["images/banners/banner03.jpg", "http://bigalliance.spreadshirt.com", "_new"]
fadeimages[3]=["images/banners/bRuins.jpg", "javascript:nav('relRuins');", ""]
fadeimages[4]=["images/banners/bHitOnRem.jpg", "javascript:nav('relHitOnRem');", ""]
//fadeimages[3]=["images/banners/bNights.jpg", "/nights", ""]

//var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
//fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax
//fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
//fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
 
var fadebgcolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}
//*********************
function pausecomp(millis) {
	var date = new Date();
	var curDate = null;
	do { curDate = new Date(); } 
	while(curDate-date < millis);
} 
function episode() {
	var ep = document.getElementById("currentEp").value;
	window.open("radio/episode.php?ep="+ep,"","width=430,height=170,menubar=0,resizable=0,scrollbars=0,location=0");
}