var curoption;

function getContent(link){
	var option = parsePagename(link);
	
	curoption = option;
	var url = 'http://lauradelallo.com/'+option+'.php';
	var pars = '';
	
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: pars, 
				onSuccess: showContent,
				onFailure: ajaxError
			});
	
	
}

function getBandMemberDetails(id){
	
	var url = 'http://lauradelallo.com/banddetail.php';
	var pars = 'id='+id;
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: pars, 
				onSuccess: showContent,
				onFailure: ajaxError
			});
}

function getPressDetail(id){
	var url = 'http://lauradelallo.com/pressdetail.php';
	var pars = 'id='+id;
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: pars, 
				onSuccess: showContent,
				onFailure: ajaxError
			});
}

function showContent(response){
	
	$('content').innerHTML = response.responseText;
	if(curoption == 'home'){
		$('rightpaine').className = 'backhome';
	}else{
		$('rightpaine').className = 'back';
	}
}

function ajaxError(response){
	alert(response.responseText);
}

function parsePagename(link){
	var myregexp = /option=(.+)/;
	result = link.match(myregexp);
	if(result){
		return result[1];
	}else{
		return "home";
	}
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

function playClip(id){
	
	thisMovie("secClips30").playClip(id);

}

var curpos = 0;
function showPhoto(dir,folder,numphotos){
	
	curpos = curpos + dir;

	
	if(curpos < 0){
		curpos = numphotos-1;
	}
	
	if(curpos > numphotos-1){
		curpos = 0;
	}
	
	$('photobucket').innerHTML = '<img src="photos/'+folder+'/'+photos[curpos]['filename']+'" border="0" title="'+photos[curpos]['caption']+'"/>';
	
	
}

function changeshirt(choice){
	if(choice == 0){
		$('tshirtbucket').src = "img/tshirt_blue.gif";
	}else{
		$('tshirtbucket').src = "img/tshirt_maroon.gif";
	}
}