//
// soundcontrol.js 
// Javascript file is to read Cookies and start playing file if soundoff cookie is not set.
//
var Cookies = new CookieHandler();	

var soundoffonpage = 0 ;
			
soundManager.url = '/flash/soundmanager2.swf';

soundManager.debugMode = false;
soundManager.consoleOnly = true;
soundManager.allowPolling = true;


soundManager.onload = function() {
	soundManager._writeDebug('soundManager.onload() - your code executes here') ;
	// soundManager is initialised, ready to use. Create a sound for this demo page.
	
	soundManager.createSound({
						id:'audio',
						url:'/music/greensleeves-h.mp3',
 						volume: 50 
	});
	
	if( Cookies.getCookie('soundoff') ) { 
	}else{
			soundManager.play('audio') ;
			soundManager.setPosition('audio',Cookies.getCookie('positioncookieaudio')) ;
	}
	//setPosition(id:string,msecOffset:integer)
	//position;
}

function markpostion() {
	mySMSound = soundManager.getSoundById('audio');
	Cookies.setCookie('audio',mySMSound.position,60*60) ;
}

function deletepostion(soundid) {
	var poscookiename='postioncookie' + soundid ;
	Cookies.deleteCookie(poscookiename) ;
}
