//Mug
var mugIn=false;

///Init function
function mugInit(_yPos,_init,_dataString,_path) {

	if(_init) {
		//Mug render
		var mug = new SWFObject(_path+"mugRender.swf", "mugSWF",300, 360, "8", "#ffffff");
		
		//Add variables to the mug
		var varList=_dataString.split('|');
		for(i in varList) {
			var parts=varList[i].split('*');
			mug.addVariable(parts[0],parts[1]);
		}
		
		//Add the url
		mug.addVariable('basePath',_path);
		
		//Params
		mug.addParam("menu", "false");
		mug.addParam("wmode", "opaque");
		
		mug.write("mugHolder");
	
		//Move the layer
		_layer=MM_findObj('mugDivHolder');
		_layer.style['top']=_yPos+'px';
		
		_layer.style['left']=(WindowWidth()-600)/2+'px';
		_layer.style['width']='300px';
		_layer.style['height']='360px';
		
		//In
		mugIn=true;
		
	} else {
		//Remove the mug
		_layer1=MM_findObj('mugDivHolder');
		_layer2=MM_findObj('mugHolder');
		
		//Move the layer - to keep it out of the way of main movie
		_layer1.style['top']='0px';
		_layer1.style['left']='0px';
		_layer1.style['width']='1px';
		_layer1.style['height']='1px';
		
		//Remove the flash
		_layer2.innerHTML='';
		
		//Out
		mugIn=false;
	}
}

//Update the mug
function mugUpdate(_var,_val) {
	//Target the mug
	_tar=MM_findObj('mugSWF');
	//Pass the variable through
	_tar.jscriptIN(_var,_val);
}