// JavaScript Document

var AlertBox;
var AlertBoxSet = false;

var AlertMessages = new Array;

AlertMessages[0] = '<h1>Save Successful!</h1>The user details have been saved.';
AlertMessages[1] = '<h1>Added Successfully!</h1>The user details have been saved.';
AlertMessages[2] = '<h1>Save Successful!</h1>The business details have been saved.';
AlertMessages[3] = '<h1>Added Successfully!</h1>The business details have been saved.';
AlertMessages[4] = '<h1>Save Successful!</h1>News Item has been updated.';
AlertMessages[5] = '<h1>Added Successfully!</h1>News Item has been added successfully.';
AlertMessages[6] = '<h1>Save Successful!</h1>Competition has been updated.';
AlertMessages[7] = '<h1>Added Successfully!</h1>Competition has been added successfully.';
AlertMessages[8] = '<h1>Save Successful!</h1>Page changes have been saved.';
AlertMessages[9] = '<h1>Added Sucessfully!</h1>Banner has been added.';
AlertMessages[10] = '<h1>Save Successful!</h1>Banner has been saved.';
AlertMessages[11] = '<h1>Save Successful!</h1>Business details have been saved.';
AlertMessages[12] = '<h1>Added Successfully!</h1>Business details have been added.';
AlertMessages[13] = '<h1>Members Only</h1>You have to be a member to access this voucher. <BR><BR> Login using the form above or <a href="register.php">Register</a>';

	function GetAlertBox(Action,MsgID,Type){
	
	// Seting type to 0 means its a Form Submission
	// Seting type to 1 means its a link
	
	CreateAlertBox(Action,MsgID,Type);
	
	}
	
	function CreateAlertBox(Action,MsgID,Type){
	var dv;
	var AlertBox ='';
	AlertBox = AlertBox + AlertMessages[MsgID];
	if(Type==1){
	AlertBox = AlertBox + '<BR><BR><a href="'+Action+'">Yes</a> | <a href="javascript:removeDiv();">No</a>';
	} else if (Type==2){
	AlertBox = AlertBox + '<BR><BR><a href="javascript:removeDiv();">Close</a>';
	}
	
	AlertBoxSet = true;
	
	dv = document.createElement('div');
	dv.setAttribute('id',"AlertBox");
	
	dv.innerHTML=AlertBox;
	document.body.appendChild(dv);
	
	
	}
	
	function removeDiv(){
		//removeChild
		var dv;
		dv = document.getElementById('AlertBox');
		document.body.removeChild(dv );
	}
	
	
	
	
	function removeAnyDiv(divname){
		//removeChild
		var dv;
		dv = document.getElementById(divname);
		document.body.removeChild(dv );
	}
	

