function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString()+";path=/");
}



function checkCookie(){	
	playCookie=getCookie('play');
	if(playCookie!=null && playCookie!=""){
		//do nothing
	}
	/*else{
		var c1=confirm("Would you like to listen to music from Bible Baptist Church?");
		if (c1==true){
			//open new borderless window with music player page
			window.open('http://music.bbcjax.com','welcome','width=310,height=600,menubar=0,status=0,location=0,toolbar=0,scrollbars=0,top=0,left=0');
			//set cookie to to expire in one day
			setCookie('play','set',1);
		}
		else {
			var c2=confirm("Would you like to stop us asking you for 90 days?");
			if (c2==true){
				//set cookie to expire in 90 days
				setCookie('play','set',90);
			}
			else{
				//set cookie to expire in one day
				setCookie('play','set',1);
			}
		}
	}*/
}
