function main_DoFSCommand(command, args) { 
	if(command == 'call_message') {
		alert(args);
	} 
	if(command == 'call_popUpAd') {	
	
		var newwindow;
		
		var leftPos = (screen.width-402)/2;
		var topPos = (screen.height-337)/2;
		
		newwindow = window.open(args, 'mmwin', 'height=337, width=402,left=' + leftPos + ',top=' + topPos);
		if (window.focus) {
			newwindow.focus();
		}		
	} 
	if(command == 'call_popUpImg') {	
	
		popImage(args,'Walter Bread - Delicious Healthy Baked Products');
	} 
	if(command == 'call_cookie'){
	
		createCookie(name);
		
	}

}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function createCookie(name) {
		var days = 1;
		var value = "";
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60));
		var expires = "; expires="+date.toGMTString();
		
		var x = readCookie(args)
		if (x) {
			document.cookie = name+"="+value+expires+"; path=/";
		}
		
}
