//for MCX Symbol list dialogbox
//for MCX Symbol list dialogbox
$(function(){
		$("#token-unassign-dialog").dialog({
		    autoOpen: false,
			resizable: 'se',
			bgiframe: true,
			height: 200,
			width:600,
			modal: true,
			buttons: { 
						"Cancel": function() { 
							$(this).dialog("close"); 
						}, 
						"Unassign": function() { 
							unassignToken();
						} 
					}
	});
	$("#token-notassign-dialog").dialog({
		    autoOpen: false,
			resizable: 'se',
			bgiframe: true,
			height: 200,
			width:600,
			modal: true,
			buttons: { 
						"Cancel": function() { 
							$(this).dialog("close"); 
						}, 
						"Submit": function() { 
							notUsableToken();
						} 
					}
	});	
	
	$("#dialog_add").dialog({
		    autoOpen: false,
			resizable: 'se',
			bgiframe: true,
			height: 100,
			width:415,
			modal: true,
			buttons: {
						"Cancel": function() { 
							$(this).dialog("close"); 
						}, 
						"Ok": function() { 
							dispatchEvent('add');
						} 
					}
	});
	$("#uniqueIdForAdd").click(function(){
	$('#dialog_add').dialog('open');
	});
	
	$("#dialog_remove").dialog({
		    autoOpen: false,
			resizable: 'se',
			bgiframe: true,
			height: 80,
			width:418,
			modal: true,
			buttons: {
						"Cancel": function() { 
							$(this).dialog("close"); 
						}, 
						"Yes": function() { 
							dispatchEvent('remove');
						} 
					}

	});


	
		$("#uniqueIdForRemove").click(function(){
	$('#dialog_remove').dialog('open');

	});
	
	
	
	$("#dialog_reset").dialog({
		    autoOpen: false,
			resizable: 'se',
			bgiframe: true,
			height: 80,
			width:482,
			modal: false,
			buttons: {
						"Cancel": function() { 
							$(this).dialog("close"); 
						}, 
						"Yes": function() { 
							dispatchEvent('reset');
						} 
					}

	});
	
		$("#uniqueIdForReset").click(function(){
	$('#dialog_reset').dialog('open');

	});

});

function fireCommandLinkEvent(linkId){
	//alert('entered');

	var fireOnThis = document.getElementById(linkId);
	  if (document.createEvent)
	  {
		//alert('dd');
	    var evObj = document.createEvent('MouseEvents');
	    evObj.initEvent( 'click', true, false );

		fireOnThis.dispatchEvent(evObj);
	 }
	  else if (document.createEventObject)
	  {
	  //alert('dd1');
	    fireOnThis.fireEvent('onclick');
	  }
	  

}


